• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • copyartifact-plugin
    • None
    • SLES 11.2, Jenkins 1.411

      When copying an executable file, the copied file is not executable, that is to say parts of the file permissions are lost.

          [JENKINS-9741] Copy artifact loses file permissions

          Angela Johansson created issue -
          Alan Harder made changes -
          Link New: This issue duplicates JENKINS-8140 [ JENKINS-8140 ]
          Alan Harder made changes -
          Link New: This issue depends on JENKINS-9397 [ JENKINS-9397 ]

          Alan Harder added a comment -

          This was supposedly fixed by JENKINS-9397, but there's another comment on that issue stating it may not actually work yet. Perhaps add a comment over there.

          Alan Harder added a comment - This was supposedly fixed by JENKINS-9397 , but there's another comment on that issue stating it may not actually work yet. Perhaps add a comment over there.

          Code changed in jenkins
          User: alanharder
          Path:
          src/main/java/hudson/plugins/copyartifact/FilePathCopyMethod.java
          http://jenkins-ci.org/commit/copyartifact-plugin/defe9664862dd9e41f8f7ca87b42209fa320d150
          Log:
          JENKINS-9741 partial fix for preserving file permissions when copying
          artifacts. Use FilePath.copyToWithPermission to fix issue when "flatten"
          option is chosen.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: src/main/java/hudson/plugins/copyartifact/FilePathCopyMethod.java http://jenkins-ci.org/commit/copyartifact-plugin/defe9664862dd9e41f8f7ca87b42209fa320d150 Log: JENKINS-9741 partial fix for preserving file permissions when copying artifacts. Use FilePath.copyToWithPermission to fix issue when "flatten" option is chosen.

          Alan Harder added a comment -

          Looks like that other fix just gets the right permissions for the file in the archive, but does not deal with how copyartifact then copies them. I looked into this and found a FilePath.copyToWithPermission that preserves permissions for a single file copy, so I switched to that in the copyartifact code that is used when the "flatten" option is chosen. When not using this option, FilePath.copyRecursiveTo delegates the work to org.apache.tools.ant.taskdefs.Copy which does not appear to support preserving permissions.

          Alan Harder added a comment - Looks like that other fix just gets the right permissions for the file in the archive, but does not deal with how copyartifact then copies them. I looked into this and found a FilePath.copyToWithPermission that preserves permissions for a single file copy, so I switched to that in the copyartifact code that is used when the "flatten" option is chosen. When not using this option, FilePath.copyRecursiveTo delegates the work to org.apache.tools.ant.taskdefs.Copy which does not appear to support preserving permissions.
          Alan Harder made changes -
          Assignee Original: Alan Harder [ mindless ]
          Alan Harder made changes -
          Link New: This issue is related to JENKINS-9996 [ JENKINS-9996 ]

          dogfood added a comment -

          Integrated in plugins_copyartifact #53
          JENKINS-9741 partial fix for preserving file permissions when copying

          alanharder : defe9664862dd9e41f8f7ca87b42209fa320d150
          Files :

          • src/main/java/hudson/plugins/copyartifact/FilePathCopyMethod.java

          dogfood added a comment - Integrated in plugins_copyartifact #53 JENKINS-9741 partial fix for preserving file permissions when copying alanharder : defe9664862dd9e41f8f7ca87b42209fa320d150 Files : src/main/java/hudson/plugins/copyartifact/FilePathCopyMethod.java
          Alan Harder made changes -
          Link New: This issue is related to JENKINS-10805 [ JENKINS-10805 ]

            kohsuke Kohsuke Kawaguchi
            dreamtime Angela Johansson
            Votes:
            11 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: