Bug 79887 - [Import/Export] Zip Export should preserve permissions
Summary: [Import/Export] Zip Export should preserve permissions
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Linux
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-12-01 11:42 EST by Aaron Luchko CLA
Modified: 2019-09-06 16:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Luchko CLA 2004-12-01 11:42:06 EST
Step to reproduce:
1. Create project with a text file.
2. Set the file as read-only in the properties (ensure read-only is set properly
outside of eclipse, -rw-r--r--)
3. Export as a zip file
4. Unpack the zip file, in eclipse it's no longer marked as read-only,
confirming the permissions of the files outside of eclipse on the command line
one gets -rw-rw-r--

One gets similar results if you give the file executable permissions as well/

Expected Results:
The zip operation should preserve read-only and executable permissions.
Comment 1 Rafael Chaves CLA 2004-12-01 12:02:12 EST
This has been reported a long time ago (bug 28147, marked as dup of bug 25387).
Comment 2 Billy Biggs CLA 2004-12-01 16:22:13 EST
Those bugs more or less talk about the general file system import/export case. 
There are some issues specific to Zip files which are awkward.

The zip format itself does not support file permissions, these are an extension
done in Info-ZIP, the most popular implementation on UNIX systems.  As a
consequence,  Java's zip file support does not include the ability to set the
permissions on files:

  http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/ZipEntry.html

To fix this we would either have to try to add this support (it may not be hard,
I assume you can do it using the extra data section?) or use an existing
implementation like the one in apache ant.
Comment 3 Billy Biggs CLA 2004-12-23 23:05:01 EST
I did some research and while I'm not entirely sure, my impression is that the
permissions information is placed in the zip header and not in the extra data,
which means we may not be able to access it through the java zip API.
Comment 4 Susan McCourt CLA 2009-07-15 12:11:01 EDT
"As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009"
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:06:09 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.