From 9334f086e1dbca44d492209ab077d0c31eadc6d1 Mon Sep 17 00:00:00 2001 From: Petr Stodulka Date: Jul 14 2017 15:36:50 +0000 Subject: restore of unix timestam accurately Resolves: #1451953 --- diff --git a/unzip-6.0-timestamp.patch b/unzip-6.0-timestamp.patch new file mode 100644 index 0000000..2aa9424 --- /dev/null +++ b/unzip-6.0-timestamp.patch @@ -0,0 +1,41 @@ +From: "Steven M. Schweda" +Subject: Do not ignore extra fields containing Unix Timestamps +Bug-Debian: https://bugs.debian.org/842993 +X-Debian-version: 6.0-21 + +--- a/process.c ++++ b/process.c +@@ -2914,10 +2914,13 @@ + break; + + case EF_IZUNIX2: +- if (have_new_type_eb == 0) { +- flags &= ~0x0ff; /* ignore any previous IZUNIX field */ ++ if (have_new_type_eb == 0) { /* (< 1) */ + have_new_type_eb = 1; + } ++ if (have_new_type_eb <= 1) { ++ /* Ignore any prior (EF_IZUNIX/EF_PKUNIX) UID/GID. */ ++ flags &= 0x0ff; ++ } + #ifdef IZ_HAVE_UXUIDGID + if (have_new_type_eb > 1) + break; /* IZUNIX3 overrides IZUNIX2 e.f. block ! */ +@@ -2933,6 +2936,8 @@ + /* new 3rd generation Unix ef */ + have_new_type_eb = 2; + ++ /* Ignore any prior EF_IZUNIX/EF_PKUNIX/EF_IZUNIX2 UID/GID. */ ++ flags &= 0x0ff; + /* + Version 1 byte version of this extra field, currently 1 + UIDSize 1 byte Size of UID field +@@ -2953,8 +2958,6 @@ + uid_size = *((EB_HEADSIZE + 1) + ef_buf); + gid_size = *((EB_HEADSIZE + uid_size + 2) + ef_buf); + +- flags &= ~0x0ff; /* ignore any previous UNIX field */ +- + if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf, + uid_size, &z_uidgid[0]) + && diff --git a/unzip.spec b/unzip.spec index 7b7f9e4..5a43fdb 100644 --- a/unzip.spec +++ b/unzip.spec @@ -7,7 +7,7 @@ Summary: A utility for unpacking zip files Name: unzip Version: 6.0 -Release: 33%{?dist} +Release: 34%{?dist} License: BSD Group: Applications/Archiving Source: http://downloads.sourceforge.net/infozip/unzip60.tar.gz @@ -54,6 +54,9 @@ Patch19: unzip-6.0-alt-iconv-utf8.patch Patch20: unzip-6.0-alt-iconv-utf8-print.patch Patch21: 0001-Fix-CVE-2016-9844-rhbz-1404283.patch +# restore unix timestamp accurately +Patch22: unzip-6.0-timestamp.patch + URL: http://www.info-zip.org/UnZip.html BuildRequires: bzip2-devel @@ -91,6 +94,7 @@ a zip archive. %patch19 -p1 -b .utf %patch20 -p1 -b .utf-print %patch21 -p1 -b .cve-2016-9844 +%patch22 -p1 -b .timestamp %build # IZ_HAVE_UXUIDGID is needed for right functionality of unzip -X @@ -111,6 +115,10 @@ make -f unix/Makefile prefix=$RPM_BUILD_ROOT%{_prefix} MANDIR=$RPM_BUILD_ROOT/%{ %{_mandir}/*/* %changelog +* Fri Jul 14 2017 Petr Stodulka - 6.0.34 +- restore of unix timestam accurately + Resolves: #1451953 + * Sat Feb 11 2017 Fedora Release Engineering - 6.0-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild