You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/03/29 19:57:35 UTC

DO NOT REPLY [Bug 41985] New: - Zip task changes the file attributes

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985

           Summary: Zip task changes the file attributes
           Product: Ant
           Version: 1.7.0
          Platform: Other
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: ofirda@gmail.com


When running the ZIP task it changes the file attributes from Read Only to 
R/W, this should not happen, the original file attributes should be preserved.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985


stevel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From stevel@apache.org  2007-04-02 02:12 -------
Do you mean, when <zip> creates a new file, it creates it with the default
permissions of the user, rather than those of whatever the file was in place?

if so, I dont think we're going to change it. Your build files should be
designed to work cross platform, regardless of whether the output files should
exist or not. If you want to set the permissions after a <zip>, use <chmod>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From stevel@apache.org  2007-04-10 02:24 -------
Ofir. when ant creates a <zip> file from all files in a directory, it will not
pick up any permissions from the files in the filesystem.

That is, if you have a file in the filesys marked read-only or exec, when it
gets into the zip it will have R/W permissions. We do not read the filesystem
permissions. As the manual says, "Note that file permissions will not be stored
in the resulting zipfile.".

You can explicitly list perms using a <zipfileset>.
http://ant.apache.org/manual/CoreTypes/zipfileset.html

Now, is this the problem? That permissions in the file system are not being
picked up and passed to entries in the zip file?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by Jeffrey E Care <ca...@us.ibm.com>.
I've already replied to BugZilla for reasons why Ant behaves the way that 
it does, but my standard advice to people who need to preserve permissions 
in archives is to exec the proper native archiver.

____________________________________________________________________________________________ 

Jeffrey E. (Jeff) Care 
carej@us.ibm.com 
IBM WebSphere Application Server 
Systems Management Tools Architecture & Development 







bugzilla@apache.org 
04/10/2007 01:19 PM
Please respond to
"Ant Developers List" <de...@ant.apache.org>


To
dev@ant.apache.org
cc

Subject
DO NOT REPLY [Bug 41985]  - Zip task changes the file attributes of 
entries when updating the archive






DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From ofirda@gmail.com  2007-04-10 10:19 
-------
Steve - your description is right, that is exactly the problem...or WAS 
the 
problem, since you now showed me that I missed this part in the specs.

I will retry with the <zipfileset>, although I do believe that the 
filesystme's attributes should have been preserved when zipping by 
default, 
maybe you can consider adding a new parameter to the <zip> task to specify 

this.

FYI - I have tried to zip with winzip and 7-zip, both of these zipped the 
files WITH their original attributes within the filesystem, so why 
shouldn't 
ANT behave the same?

-- 
Configure bugmail: 
http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From ofirda@gmail.com  2007-04-10 10:19 -------
Steve - your description is right, that is exactly the problem...or WAS the 
problem, since you now showed me that I missed this part in the specs.

I will retry with the <zipfileset>, although I do believe that the 
filesystme's attributes should have been preserved when zipping by default, 
maybe you can consider adding a new parameter to the <zip> task to specify 
this.

FYI - I have tried to zip with winzip and 7-zip, both of these zipped the 
files WITH their original attributes within the filesystem, so why shouldn't 
ANT behave the same?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From ofirda@gmail.com  2007-04-06 06:06 -------
I think the title is misleading, I have encountered this when I INITIALLY 
archived a folder containing files, not during an update of an existing zip 
file.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task doesnt pick up the read-only state of files when adding

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985


stevel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Zip task changes the file   |Zip task doesnt pick up the
                   |attributes of entries when  |read-only state of files
                   |updating the archive        |when adding




------- Additional Comments From stevel@apache.org  2007-04-11 02:27 -------
Ok, I've changed the title of the bugrep again,to make it clear its about the RO
bit.

As Jeffrey says, we have been constrained by Java, pre-1.6. Permissions get lost
on <zip>, <tar> and <copy>. More subtly, we are constrained by the need to be
cross platform...you need builds that work on windows as well as unix, so can't
rely on permission bits. Forcing people to use the <zipfileset> permissions does
guarantee that the build file will work on windows, as well as unix.

that said, as alexy notes, the read/read-only flag does appear to be more
portable. File.setReadOnly() is java1.2+ and file.canWrite() is java1.0 era, so
we should be able to propage the writeable flag. For java1.6+, we can even make
a go at execute permissions, though I don't know what happens on Windows in that
situation. Or -and this is the one that scares me- cygwin on windows.

Because of that possibility, I'm leaving this open, instead of WONTFIX/CANTFIX.
We may be able to do something about this, now.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task doesnt pick up the read-only state of files when adding

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985


jkf@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985


ofirda@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




------- Additional Comments From ofirda@gmail.com  2007-04-05 03:55 -------
(In reply to comment #0)
> When running the ZIP task it changes the file attributes from Read Only to 
> R/W, this should not happen, the original file attributes should be 
preserved.

First, to make sure its clear - I am refering to the files WITHIN the zip file 
and not to the attributes of the zip file itself. The files contained in the 
zip are NOT perserving their original attributes (Read Only) and they become 
Read/Write, you can see this after you extract the zip.

Second, the problem is appearing in Windows OS (I have not tested on UNIX), 
since in Windows you cannot grant default attributes to a new file created 
(i.e. Read Only), each file created appears with R/W.

I assume that the problem is in ANT <zip> task since if I use other zip 
software (such as winzip command line tool) the files' attributes are 
perserved within the zip file, it can be seen after they are being extracted.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From alexeys@inventigo.com  2007-04-10 08:02 -------
Maybe it is time to rethink it. R/W attributes are available for some time and
executable permission is in Java 6. Backward compatibility can be affected, so
permission handling should be optional.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985


stevel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Zip task changes the file   |Zip task changes the file
                   |attributes                  |attributes of entries when
                   |                            |updating the archive




------- Additional Comments From stevel@apache.org  2007-04-05 14:08 -------
ahh, now the bugrep makes sense. Changing the title to use the terminology of
the team.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41985] - Zip task changes the file attributes of entries when updating the archive

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41985





------- Additional Comments From carej@us.ibm.com  2007-04-10 10:38 -------
Because there's no way to faithfully query the permissions in a pure-Java way?

Take a closer look at the permission-related API additions to java.io.File: I
don't see a way to query ALL of the permission data. The APIs that are there can
only tell you if the current process can read, write or execute a given file -
they don't cover world or groups.

You can _almost_ make an argument for permission preservation for <unzip>, but
even there the APIs don't cover standard UNIX permissions.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org