ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: keeping file permission in warfile
Date Tue, 14 Jan 2003 12:17:37 GMT
On Tue, 14 Jan 2003, Laurence Mastrorillo <mastrori@medias.cnes.fr>
wrote:

> But after I extract the war-file, they loose the '+x' permission, as
> if 'waring' files resets permissions.

There are a couple of problems coming together here:

(1) Java doesn't know about file permissions -> Ant cannot read them
and thus doesn't know them.

(2) ZIP archives do not really know about permissions either.  There
is a common format to store file permissions inside the "external
attributes" of the archive that is understood by all ZIP
implementations that are based on InfoZIP's code (this includes
WinZIP).

(3) Java's util.zip package doesn't provide access to the external
attribute.  Ant uses a zip package of its own to get around this, but
up to 1.5.x it only used the feature to ensure directories will get
the execute bit set.  In CVS HEAD (and thus in 1.6alpha), you can tell
Ant which permissions to use for the entries.

(4) Java's util.zip package doesn't provide access to the external
attribute, again.  This time the problem is when extracting the war
file.  If your servlet container uses Java classes to extract the
archive, it will most probably not restore the permissions, even if
they are correct inside the archive.

So apart from performing an explicit chmod after deployment, you can
only create your warfile using Ant 1.6alpha and extract it manually at
your deployment site using your native unzip command instead of
letting your servlet container do this.

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message