JDK-4931799 : file executable permission is lost when extracting from jar file
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris
  • CPU: generic
  • Submitted: 2003-10-02
  • Updated: 2006-12-14
  • Resolved: 2006-12-14
Related Reports
Duplicate :  
Relates :  
Description
On solaris and linux, j2se 1.3, 1.4 and 1.5:

when I add a file with executable permissions to the jar:

-rwxr--r--   1 ngthomas staff        932 Oct  2 13:12 notepad.jnlp*

and then extract the file back from the jar:

-rw-r--r--   1 ngthomas staff        932 Oct  2 13:22 notepad.jnlp

the executable permission is lost.

If I do the same thing with zip, the permission is preserved.

Comments
EVALUATION Closing as dup of more general bug: it's not just execute permissions, but all permissions, as well as ownership.
14-12-2006

PUBLIC COMMENTS -
10-06-2004

EVALUATION The "standard" zip file format does not have any way to store "executable file" meta-information, since it was originally designed for MS-DOS filesystems. In order to preserve Unix information like file modes, the zip handling code would have to handle extensions to the zip file format. Other zip implementations have such extensions. We should support those extensions. But doing so is a lot of work, and will not happen for J2SE 1.5. ###@###.### 2003-10-06 Martin, I disagree with you about downgrading this bug - from the WebStart perspective, it's a show stopper bug. For example, I put an executable file into a jar file and provided a jnlp file so that user can run the executable file via the webstart mechanism, but now, when users downloaded and extracted the jar file, that file is no longer executable, users have to manually change the file's attribute in the jnlp cache directory, that is not acceptable. ###@###.### 2003-10-07 It is too late to fix this for Tiger. Hopefully, we can add this to Mustang as part of an effort to support Zip file format extensions implemented by other vendors. ###@###.### 2003-10-08
08-10-2003