Bug 404831 - Archived artifacts do not preserve permissions
Summary: Archived artifacts do not preserve permissions
Status: ASSIGNED
Alias: None
Product: Hudson
Classification: Technology
Component: Core (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Winston Prakash CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 12:58 EDT by Eduardo Alapisco CLA
Modified: 2016-03-22 11:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo Alapisco CLA 2013-04-03 12:58:26 EDT

    
Comment 1 Eduardo Alapisco CLA 2013-04-03 13:04:23 EDT
All archived files loose their permissions setting when stored as artifacts on the 
master node. 

simple steps to reproduce:

- Create a Shell script and create some file with certain permissions
- Archive the file and check if the file permission is correct
- In the workspace the permission is correct. But in the archive folder
it is not correct
Comment 2 Winston Prakash CLA 2013-04-05 20:17:05 EDT
Hudson is using Copy utility from Ant library
<http://www.jajakarta.org/ant/ant-1.6.1/docs/en/manual/api/org/apache/tools/ant/taskdefs/Copy.html>,
which does not seem to preserve the file permission. The reason why it
uses the Ant library is because Hudson uses the same file mask (e.g
target/**/test*) as in ant. 

Need to find out another way to do the copying
Comment 3 Andreas Sewe CLA 2016-03-22 11:33:26 EDT
Hi,

I would be also very interested in a fix for this one, due to the following use case:

- We have a shell script (tools/hudson/publish.sh) checked into SCM, which is run during a promotion process's "Execute Shell" build step.

- ATM, we refer to the script like this

  ${WORKSPACE}/tools/hudson/publish.sh

- Obviously, the workspace may have changed between the time the build finishes  and the time it was promoted, which is bad.

- The ideal solution would be having tools/hudson/publish.sh as "artifacts/to/archive" and then refering to the script like this

  ${HUDSON_HOME}/jobs/${PROMOTED_JOB_NAME}/builds/${PROMOTED_ID}/archive/tools/hudson/publish.sh

Unfortunately, due to this bug, this doesn't work. While the script is executable in the workspace, it is not in the archive; the promotion hence fails.