View Issue Details

IDProjectCategoryView StatusLast Update
0016185CentOS-7unzippublic2019-06-17 14:22
Reporterphineas42 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version7.6.1810 
Target VersionFixed in Version 
Summary0016185: The -X option to unzip has never worked on Unix/Linux.
Description(Same as Fedora Bug https://bugzilla.redhat.com/show_bug.cgi?id=1139053)

Files extracted with unzip are owned by root:root even when -X is specified.
Steps To Reproduce1. Create a zip file archiving one or more files not owned by root:root.
   (Zip version 3.0) linux# zip /tmp/test.zip /home/*/.cshrc
2. mkdir /tmp/testing; cd /tmp/testing; unzip -X /tmp/test.zip
3. ls -l home/*/*

Actual results:
  All extracted files are owned by root:root.

Expected results:
  Extracted files should have correct owner and group IDs.
Additional Information   The code for -X depends on preprocessor definitions that are never defined.

This bug has been patched in Debian, and fc19+.
TagsNo tags attached.
abrt_hash
URLhttps://bugzilla.redhat.com/show_bug.cgi?id=1139053

Activities

phineas42

phineas42

2019-06-14 17:06

reporter  

unzip-6.0-restore-uid-gid.patch (1,167 bytes)
--- ./process.c.orig    2009-03-06 02:25:10.000000000 +0100
+++ ./process.c 2013-09-12 10:51:16.000000000 +0200
@@ -2936,9 +2936,9 @@
         */
 
 #ifdef IZ_HAVE_UXUIDGID
-            if (eb_len >= EB_UX3_MINLEN
-                && z_uidgid != NULL
-                && (*((EB_HEADSIZE + 0) + ef_buf) == 1)
+            if ((eb_len >= EB_UX3_MINLEN)
+                && (z_uidgid != NULL)
+                && ((*((EB_HEADSIZE + 0) + ef_buf) == 1)))
                     /* only know about version 1 */
             {
                 uch uid_size;
@@ -2950,10 +2950,10 @@
                 flags &= ~0x0ff;      /* ignore any previous UNIX field */
 
                 if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
-                                    uid_size, z_uidgid[0])
+                                    uid_size, &z_uidgid[0])
                     &&
                      read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf,
-                                    gid_size, z_uidgid[1]) )
+                                    gid_size, &z_uidgid[1]) )
                 {
                     flags |= EB_UX2_VALID;   /* signal success */
                 }
unzip.spec.patch (897 bytes)
--- unzip.spec	2018-04-10 15:32:09.000000000 -0500
+++ unzip-new.spec	2019-06-14 12:01:25.711492538 -0500
@@ -34,6 +34,7 @@
 Patch15: unzip-6.0-alt-iconv-utf8.patch
 Patch16: unzip-6.0-alt-iconv-utf8-print.patch
 Patch17: unzip-6.0-symlink.patch
+Patch18: unzip-6.0-restore-uid-gid.patch
 
 
 #Patch14: unzip-6.0-alt-iconv-utf8.patch
@@ -75,6 +76,7 @@
 %patch15 -p1 -b .utf
 %patch16 -p1 -b .utf-print
 %patch17 -p1 -b .symlink
+%patch18 -p1 -b .restore-uid-gid.patch
 
  # Settings for EL <= 7
 %if 0%{?rhel} && 0%{?rhel} <= 7
@@ -84,7 +86,7 @@
 
 
 %build
-make -f unix/Makefile CF_NOOPT="-I. -DUNIX $RPM_OPT_FLAGS -DNOMEMCPY -DNO_LCHMOD" LFLAGS2="%{?__global_ldflags}" generic_gcc %{?_smp_mflags}
+make -f unix/Makefile CF_NOOPT="-I. -DUNIX $RPM_OPT_FLAGS -DNOMEMCPY -DNO_LCHMOD -DIZ_HAVE_UXUIDGID" LFLAGS2="%{?__global_ldflags}" generic_gcc %{?_smp_mflags}
 
 %install
 rm -rf $RPM_BUILD_ROOT
unzip.spec.patch (897 bytes)
TrevorH

TrevorH

2019-06-14 18:09

manager   ~0034672

CentOS is a rebuild of the sources used to create RHEL. We do not modify anything except to remove branding and logos. You will need to submit your request to Redhat via bugzilla.redhat.com and if/when RH accepts it and incorporates it into RHEL and releases a patched version, then CentOS will pick it up and rebuild it.
phineas42

phineas42

2019-06-17 14:22

reporter   ~0034683

Thanks. The RHEL bug is now at https://bugzilla.redhat.com/show_bug.cgi?id=1720761

Issue History

Date Modified Username Field Change
2019-06-14 17:06 phineas42 New Issue
2019-06-14 17:06 phineas42 File Added: unzip-6.0-restore-uid-gid.patch
2019-06-14 17:06 phineas42 File Added: unzip.spec.patch
2019-06-14 18:09 TrevorH Note Added: 0034672
2019-06-17 14:22 phineas42 Note Added: 0034683