mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8250968: Symlinks attributes not preserved when using jarsigner on zip files
Reviewed-by: lancea, weijun, hchao
This commit is contained in:
parent
8d6d43c33b
commit
7686e87155
10 changed files with 199 additions and 38 deletions
|
@ -658,8 +658,8 @@ public class ZipFile implements ZipConstants, Closeable {
|
|||
e.csize = CENSIZ(cen, pos);
|
||||
e.method = CENHOW(cen, pos);
|
||||
if (CENVEM_FA(cen, pos) == FILE_ATTRIBUTES_UNIX) {
|
||||
// 12 bits for setuid, setgid, sticky + perms
|
||||
e.posixPerms = CENATX_PERMS(cen, pos) & 0xFFF;
|
||||
// read all bits in this field, including sym link attributes
|
||||
e.extraAttributes = CENATX_PERMS(cen, pos) & 0xFFFF;
|
||||
}
|
||||
|
||||
if (elen != 0) {
|
||||
|
@ -1096,14 +1096,13 @@ public class ZipFile implements ZipConstants, Closeable {
|
|||
public Stream<String> entryNameStream(ZipFile zip) {
|
||||
return zip.entryNameStream();
|
||||
}
|
||||
// only set posix perms value via ZipEntry contructor for now
|
||||
@Override
|
||||
public int getPosixPerms(ZipEntry ze) {
|
||||
return ze.posixPerms;
|
||||
public int getExtraAttributes(ZipEntry ze) {
|
||||
return ze.extraAttributes;
|
||||
}
|
||||
@Override
|
||||
public void setPosixPerms(ZipEntry ze, int perms) {
|
||||
ze.posixPerms = perms;
|
||||
public void setExtraAttributes(ZipEntry ze, int extraAttrs) {
|
||||
ze.extraAttributes = extraAttrs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue