< prev index next >

src/java.base/share/classes/java/util/zip/ZipUtils.java

Print this page
rev 51866 : 6194856: Zip Files lose ALL ownership and permissions of the files

*** 23,33 **** * questions. */ package java.util.zip; ! import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.file.attribute.FileTime; import java.security.AccessController; import java.security.PrivilegedAction; import java.time.DateTimeException; --- 23,34 ---- * questions. */ package java.util.zip; ! import static java.util.zip.ZipConstants.ENDHDR; ! import java.nio.ByteBuffer; import java.nio.file.attribute.FileTime; import java.security.AccessController; import java.security.PrivilegedAction; import java.time.DateTimeException;
*** 35,48 **** import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; import java.util.concurrent.TimeUnit; - import static java.util.zip.ZipConstants.ENDHDR; - import jdk.internal.misc.Unsafe; - import sun.nio.ch.DirectBuffer; class ZipUtils { // used to adjust values between Windows and java epoch private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L; --- 36,46 ----
*** 255,264 **** --- 253,263 ---- static final long ZIP64_LOCOFF(byte[] b) { return LL(b, 8);} // zip64 end offset // central directory header (CEN) fields static final long CENSIG(byte[] b, int pos) { return LG(b, pos + 0); } static final int CENVEM(byte[] b, int pos) { return SH(b, pos + 4); } + static final int CENVEM_FA(byte[] b, int pos) { return CH(b, pos + 5); } static final int CENVER(byte[] b, int pos) { return SH(b, pos + 6); } static final int CENFLG(byte[] b, int pos) { return SH(b, pos + 8); } static final int CENHOW(byte[] b, int pos) { return SH(b, pos + 10);} static final long CENTIM(byte[] b, int pos) { return LG(b, pos + 12);} static final long CENCRC(byte[] b, int pos) { return LG(b, pos + 16);}
*** 268,277 **** --- 267,277 ---- static final int CENEXT(byte[] b, int pos) { return SH(b, pos + 30);} static final int CENCOM(byte[] b, int pos) { return SH(b, pos + 32);} static final int CENDSK(byte[] b, int pos) { return SH(b, pos + 34);} static final int CENATT(byte[] b, int pos) { return SH(b, pos + 36);} static final long CENATX(byte[] b, int pos) { return LG(b, pos + 38);} + static final int CENATX_PERMS(byte[] b, int pos) { return SH(b, pos + 40);} static final long CENOFF(byte[] b, int pos) { return LG(b, pos + 42);} // The END header is followed by a variable length comment of size < 64k. static final long END_MAXLEN = 0xFFFF + ENDHDR; static final int READBLOCKSZ = 128;
< prev index next >