master hovercats/oakiss / pkg / unzip / patch / 0017-Do-not-ignore-extra-fields-containing-Unix-Timestamp.patch
 1From 528161b86e74c3afbe640c70761e6734119bea1c Mon Sep 17 00:00:00 2001
 2From: "Steven M. Schweda" <sms@antinode.info>
 3Date: Sat, 15 Jun 2019 18:13:11 -0700
 4Subject: [PATCH] Do not ignore extra fields containing Unix Timestamps
 5
 6---
 7 process.c | 11 +++++++----
 8 1 file changed, 7 insertions(+), 4 deletions(-)
 9
10diff --git a/process.c b/process.c
11index df683ea..e4f2405 100644
12--- a/process.c
13+++ b/process.c
14@@ -2914,10 +2914,13 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
15             break;
16 
17           case EF_IZUNIX2:
18-            if (have_new_type_eb == 0) {
19-                flags &= ~0x0ff;        /* ignore any previous IZUNIX field */
20+            if (have_new_type_eb == 0) {        /* (< 1) */
21                 have_new_type_eb = 1;
22             }
23+            if (have_new_type_eb <= 1) {
24+                /* Ignore any prior (EF_IZUNIX/EF_PKUNIX) UID/GID. */
25+                flags &= 0x0ff;
26+            }
27 #ifdef IZ_HAVE_UXUIDGID
28             if (have_new_type_eb > 1)
29                 break;          /* IZUNIX3 overrides IZUNIX2 e.f. block ! */
30@@ -2933,6 +2936,8 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
31             /* new 3rd generation Unix ef */
32             have_new_type_eb = 2;
33 
34+            /* Ignore any prior EF_IZUNIX/EF_PKUNIX/EF_IZUNIX2 UID/GID. */
35+            flags &= 0x0ff;
36         /*
37           Version       1 byte      version of this extra field, currently 1
38           UIDSize       1 byte      Size of UID field
39@@ -2953,8 +2958,6 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
40                 uid_size = *((EB_HEADSIZE + 1) + ef_buf);
41                 gid_size = *((EB_HEADSIZE + uid_size + 2) + ef_buf);
42 
43-                flags &= ~0x0ff;      /* ignore any previous UNIX field */
44-
45                 if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
46                                     uid_size, &z_uidgid[0])
47                     &&
48-- 
492.20.1
50