• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • git-client-plugin
    • None
    • * Red Hat Enterprise Linux 6.2
      * Jenkins 1.565.1
      * git-client-plugin 1.10.1
      * git-plugin 2.2.5

      After changing the "Git Installations" general configuration from Git to JGit whenever a new build is triggered in which a git-checkout is performed, the mode of the files changed in the workspace is wrong. In particular, files which should have mode rwxr-xr-x end up having mode rwxr-r-.

      After the workspace is wiped out all files that should have the executable bit set end up having only the user-executable bit set, not the group-executable, and not the other-executable.

      From an already checked out workspace (in which I have fixed the file modes by hand) if a new build is triggered and a git-fetch/git-checkout is performed by the plugin, all files that were changed end up with the group- and other-executable bits unset.

      I've tried this on three different Jenkins slaves and two different Jenkins masters with the same results. Always creating a free-style job from scratch.

      If I change the general "Git Installations" back to Git the problem disappears.

      I've straced the java -jar slave.jar process during the build and found this sequence of syscalls which caused the problem:

      15082 open("/n/code/bin/._server-report.pl8165876850559140433.tmp", O_RDWR|O_CREAT|O_EXCL, 0666) = 71
      15082 fstat(71, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
      15082 fcntl(71, F_GETFD)                = 0
      15082 fcntl(71, F_SETFD, FD_CLOEXEC)    = 0
      15082 close(71)                         = 0
      15082 open("/n/code/bin/._server-report.pl8165876850559140433.tmp", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 71
      15082 fstat(71, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
      15082 fcntl(71, F_GETFD)                = 0
      15082 fcntl(71, F_SETFD, FD_CLOEXEC)    = 0
      15082 write(71, "#!/usr/bin/env perl\n\n# Copyright"..., 6388) = 6388
      15082 close(71)                         = 0
      15082 access("/n/code/bin/._server-report.pl8165876850559140433.tmp", X_OK) = -1 EACCES (Permission denied)
      15082 stat("/n/code/bin/._server-report.pl8165876850559140433.tmp", {st_mode=S_IFREG|0644, st_size=6388, ...}) = 0
      15082 chmod("/n/code/bin/._server-report.pl8165876850559140433.tmp", 0100744) = 0
      15082 rename("/n/code/bin/._server-report.pl8165876850559140433.tmp", "/n/code/bin/server-report.pl") = 0
      15082 stat("/n/code/bin/server-report.pl", {st_mode=S_IFREG|0744, st_size=6388, ...}) = 0
      

      You can see that first the temporary file is created with mode 0666 and later its mode is changed (via chmod) to 0100744, clearing the executable bits.

      I've checked the umask of the user running the slave and it's 0022. I've also checked the umask of the slave process and it's 0022 too.

      I haven't found any other mention to this problem in this JIRA or Googling for it.

            ndeloof Nicolas De Loof
            gnustavo Gustavo Chaves
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: