LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-12-2013, 03:00 AM   #1
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
[Request] Info-Zip UID/GID and bzip2 support for -current


As you can see in this thread on the Info-Zip forums, UID/GID restoration is broken by default (that thread also includes a patch, as does this Debian bug report). Could this be fixed in -current?

As an additional request, it would be nice if bzip2 compression support was added to the Slackware infozip package by default as I have started to encounter more zips that use this method from Windows using friends. No other application included in Slackware can currently open these files so without support in the official Slackware package a user must either recompile infozip themselves or install pz7ip from SBo.

When recompiling infozip recently with bzip2 support I made the following change to the infozip.SlackBuild and dumped the bzip2-1.0.6.tar.gz in the directory alongside it.

Code:
--- infozip.SlackBuild.orig     2013-09-11 10:38:17.000000000 +0200
+++ infozip.SlackBuild  2013-09-11 10:39:55.000000000 +0200
@@ -45,6 +45,10 @@
 rm -rf zip$(echo $ZIP | tr -d .)
 tar xvf $CWD/zip$(echo $ZIP | tr -d .).tar.?z* || exit 1
 cd zip$(echo $ZIP | tr -d .)
+if /bin/ls $CWD/bzip2-*.tar.gz &> /dev/null; then
+  tar xf $CWD/bzip2-*.tar.gz -C bzip2 --strip 1 || exit 1
+  BZ2SUPPORT="IZ_BZIP2=$(pwd)/bzip2"
+fi
 chown -R root:root .
 mkdir -p $PKG/usr/doc/zip-$ZIP
 cp -a BUGS CHANGES INSTALL LICENSE README* TODO US* WHATSNEW WHERE \
@@ -70,7 +74,7 @@
 cp -a BUGS COPYING* Contents History.* INSTALL LICENSE README ToDo WHERE \
       $PKG/usr/doc/unzip-$VERSION
 chmod 644 $PKG/usr/doc/unzip-$VERSION/*
-make -f unix/Makefile generic || exit 1
+make -f unix/Makefile generic $BZ2SUPPORT || exit 1
 cat unzip > $PKG/usr/bin/unzip
 cat unzipsfx > $PKG/usr/bin/unzipsfx
 cat funzip > $PKG/usr/bin/funzip
There is probably a neater way to add support, though in my own testing I was not able to use bzlib.h and libbz2.a from the Slackware bzip2 package as libbz2.a was not built with BZ_NO_STDIO (Zip prefers this and UnZip requires it to add bzip2 compression support).

P.S. There is also this thread started by me on the UID/GID problems, here in LQ).

Last edited by ruario; 09-13-2013 at 02:07 AM. Reason: Clarified that I am requesting for Slackware -current
 
Old 09-12-2013, 04:21 AM   #2
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Here is a patch to infozip.SlackBuild that adds working Unix UID/GID support and bzip2 support:

Code:
--- ./infozip.SlackBuild.orig   2013-09-12 11:19:30.000000000 +0200
+++ ./infozip.SlackBuild        2013-09-12 11:15:28.000000000 +0200
@@ -45,6 +45,10 @@
 rm -rf zip$(echo $ZIP | tr -d .)
 tar xvf $CWD/zip$(echo $ZIP | tr -d .).tar.?z* || exit 1
 cd zip$(echo $ZIP | tr -d .)
+if /bin/ls $CWD/bzip2-*.tar.gz &> /dev/null; then
+  tar xf $CWD/bzip2-*.tar.gz -C bzip2 --strip 1 || exit 1
+  BZ2SUPPORT="IZ_BZIP2=$(pwd)/bzip2"
+fi
 chown -R root:root .
 mkdir -p $PKG/usr/doc/zip-$ZIP
 cp -a BUGS CHANGES INSTALL LICENSE README* TODO US* WHATSNEW WHERE \
@@ -65,12 +69,13 @@
 rm -rf unzip$(echo $VERSION | tr -d .)
 tar xvf $CWD/unzip$(echo $VERSION | tr -d .).tar.?z* || exit 1
 cd unzip$(echo $VERSION | tr -d .)
+zcat < $CWD/process.c.diff.gz | patch -p1 || exit
 chown -R root:root .
 mkdir -p $PKG/usr/doc/unzip-$VERSION
 cp -a BUGS COPYING* Contents History.* INSTALL LICENSE README ToDo WHERE \
       $PKG/usr/doc/unzip-$VERSION
 chmod 644 $PKG/usr/doc/unzip-$VERSION/*
-make -f unix/Makefile generic || exit 1
+make -f unix/Makefile generic LOCAL_UNZIP=-DIZ_HAVE_UXUIDGID $BZ2SUPPORT || exit 1
 cat unzip > $PKG/usr/bin/unzip
 cat unzipsfx > $PKG/usr/bin/unzipsfx
 cat funzip > $PKG/usr/bin/funzip
The above assumes that the bzip2 source package (bzip2-1.0.6.tar.gz) and process.c.diff.gz are present alongside infozip.SlackBuild.

Here are the uncompressed contents of process.c.diff.gz (basically the patch from the Debian bug report linked above):

Code:
--- ./process.c.orig    2009-03-06 02:25:10.000000000 +0100
+++ ./process.c 2013-09-12 10:51:16.000000000 +0200
@@ -2895,9 +2895,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;
@@ -2909,10 +2909,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 */
                 }

Last edited by ruario; 09-13-2013 at 02:10 AM. Reason: Mentioned that process.c.diff.gz uses the changes in the Debian bug report patch
 
Old 09-15-2013, 03:41 AM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Thanks Patrick!

Quote:
Originally Posted by Changelog
a/infozip-6.0-i486-2.txz: Rebuilt.
Fixed bzip2 and UID/GID support in unzip.
P.S. Your method of adding bzip2 support is far neater than mine, unsurprisingly!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What's the point of bzip2, and other compression for that matter? barnac1e Linux - Software 16 07-11-2012 09:06 PM
Slackware's 13.37 tar, and how it handles uid/gid pair on create/extract Old_Fogie Slackware 1 12-06-2011 04:12 AM
what is uid and gid rmanocha Linux - Software 9 08-18-2008 11:03 PM
cifs not using uid and gid mattd7591 Linux - General 10 07-19-2007 11:30 AM
What is my uid/gid? Jeebizz Slackware 2 11-22-2005 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration