restore of unix timestam accurately

Resolves: #1451953
This commit is contained in:
Petr Stodulka 2017-07-14 17:36:50 +02:00
parent 87704ddca0
commit 9334f086e1
2 changed files with 50 additions and 1 deletions

41
unzip-6.0-timestamp.patch Normal file
View File

@ -0,0 +1,41 @@
From: "Steven M. Schweda" <sms@antinode.info>
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])
&&

View File

@ -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 <pstodulk@redhat.com> - 6.0.34
- restore of unix timestam accurately
Resolves: #1451953
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild