Details

Description

This is definitely true for zips, and I think it's true for tars as well - when we're creating tarballs and zipfiles, we're not actually looking at the permissions/unix mode on the files and directories going into them. As a result, the tars/zips we've created have no useful permissions set. This is particularly annoying with the clone workspace SCM plugin, where files may need to be executable for the downstream to work properly.

Code changed in jenkins
User: Andrew Bayer
Path:
core/src/main/java/hudson/util/io/Archiver.java
core/src/main/java/hudson/util/io/TarArchiver.java
core/src/main/java/hudson/util/io/ZipArchiver.javahttp://jenkins-ci.org/commit/jenkins/00485b3188236f17b4962790945ae3218de98d09
Log:[FIXED JENKINS-9397] Added convenience method to hudson.util.io.Archiver to get the Unix mode (if appropriate) for a file, and modified TarArchiver and ZipArchiver to utilise this to get and set the Unix mode for files whent they're being archived.

Integrated in jenkins_main_trunk #696[FIXED JENKINS-9397] Added convenience method to hudson.util.io.Archiver to get the Unix mode (if appropriate) for a file, and modified TarArchiver and ZipArchiver to utilise this to get and set the Unix mode for files whent they're being archived.[FIXED JENKINS-9397] fixed a bug in the implementation, added tests.JENKINS-9397 recording the change

dogfood
added a comment - 16/Apr/11 1:04 AM Integrated in jenkins_main_trunk #696[FIXED JENKINS-9397] Added convenience method to hudson.util.io.Archiver to get the Unix mode (if appropriate) for a file, and modified TarArchiver and ZipArchiver to utilise this to get and set the Unix mode for files whent they're being archived.
[FIXED JENKINS-9397] fixed a bug in the implementation, added tests.
JENKINS-9397 recording the change
Kohsuke Kawaguchi : 00485b3188236f17b4962790945ae3218de98d09
Files :

I don't think this is fixed. I upgraded to 1.410 of Jenkins and 0.3 of the Clone Workspace plugin, but executable permissions on my files are still stripped after they are cloned.

I set up a super simple test of this:
1. Build 1 creates a file, runs chmod a+x on it, runs 'ls -l' so I can verify the file's perms in the console log, then archives the workspace and calls Build 2.
2. Build 2 uses the Clone Workspace SCM option and pulls in the archived files, then runs an 'ls -l' on them.

owenmehegan
added a comment - 03/May/11 11:06 PM - edited I don't think this is fixed. I upgraded to 1.410 of Jenkins and 0.3 of the Clone Workspace plugin, but executable permissions on my files are still stripped after they are cloned.
I set up a super simple test of this:
1. Build 1 creates a file, runs chmod a+x on it, runs 'ls -l' so I can verify the file's perms in the console log, then archives the workspace and calls Build 2.
2. Build 2 uses the Clone Workspace SCM option and pulls in the archived files, then runs an 'ls -l' on them.
Before:

Angela Johansson
added a comment - 20/May/11 2:46 PM - edited Sorry, commented the wrong bug
After this fix, I still have problems with both the Copy Artifact plugin AND the Clone Workspace plugin but I guess it's not related to the Archiver any more.

Code changed in jenkins
User: Andrew Bayer
Path:
core/src/main/java/hudson/util/io/Archiver.java
core/src/main/java/hudson/util/io/TarArchiver.java
core/src/main/java/hudson/util/io/ZipArchiver.javahttp://jenkins-ci.org/commit/jenkins/00485b3188236f17b4962790945ae3218de98d09
Log:[FIXED JENKINS-9397] Added convenience method to hudson.util.io.Archiver to get the Unix mode (if appropriate) for a file, and modified TarArchiver and ZipArchiver to utilise this to get and set the Unix mode for files whent they're being archived.

Code changed in jenkins
User: Andrew Bayer
Path:
core/src/main/java/hudson/util/io/Archiver.java
core/src/main/java/hudson/util/io/TarArchiver.java
core/src/main/java/hudson/util/io/ZipArchiver.javahttp://jenkins-ci.org/commit/jenkins/00485b3188236f17b4962790945ae3218de98d09
Log:[FIXED JENKINS-9397] Added convenience method to hudson.util.io.Archiver to get the Unix mode (if appropriate) for a file, and modified TarArchiver and ZipArchiver to utilise this to get and set the Unix mode for files whent they're being archived.