Re: Info-ZIP maintainer

"Cosmin T" <[email protected]> Thu, 26 Feb 2004 10:17:56 -0500
Newsgroups gmane.comp.archivers.info-zip
Message-ID <[email protected]>
>Mike wrote:
>
> > I do have a bunch of old mail that I will go through and see if there 
>are
> > any patches in there - or other potential issues. As I recall, there 
>were a
> > couple of issues that really weren't patches, but required actual fixes 
>-
> > i.e. problems given, but no solutions. I have no idea if Christian has 
>done
> > those fixes, or if anyone has even looked at them.
>
> > Greg might have these someplace if I don't have them in my mail.
>
>I have the same vague recollection, but I haven't tried to keep up.
>The main bugaboo is several known security holes involving directory-
>traversal and going back to last May or so.  The Linux-distro fixes
>presumably touch only the files in the unix/ subdir, but there were
>a few messages about what other OSes were and weren't affected.  The
>same kinds of fixes would be needed for each.

But the fixes are already in unz551c, right?
My question was: are there patches to apply to *unz551c*, besides those
that I sent in last November?

>Yes, it should have been released last June. :-(

Then we can as well release it now. My plan was to make an unz551d
bundle, containing the patches that Christian approved, during this
weekend, or let Mike do it. I asked if there are other changes to
unz551c, to be integrated into unz551d.

I was proposing to consider unz551d a release candidate, and to release
unzip 5.51 after 2 or 3 more weeks.

The patches that I am talking about do not add new functionality, they
only resolve some compatibility issues with Cygwin. Still, if you wish
to rush up the process, we can leave those for unzip 5.52 or whatever.


Here is Christian's old reply:


** forwarded message **
Date: Mon, 1 Dec 2003 21:46:46 -0500
From: Christian Spieler
Subject: Re: [Info-ZIP] Some patches for zip and unzip under Cygwin and Unix


Hello Cosmin,

Here are my comments to your patches.

diff -ru unz551c/unix/Makefile unzip-new/unix/Makefile
--- unz551c/unix/Makefile Wed May 07 18:50:10 2003
+++ unzip-new/unix/Makefile Sat Nov 22 19:34:00 2003
@@ -124,9 +124,9 @@
SYSTEMSG = generic generic2 generic3 generic_zlib generic_shlib
SYSTEMS1 = 386i 3Bx 7300 7300_gcc aix aix_rt amdahl amdahl_eft apollo aviion
SYSTEMS2 = bsd bsdi bsdi_noasm bull coherent convex cray cray_opt cyber_sgi
-SYSTEMS3 = dec dnix encore eta freebsd gcc gould hk68 hp hpux isc isc_gcc
+SYSTEMS3 = cygwin dec dnix encore eta freebsd gcc gould hk68 hp hpux isc 
isc_gcc
SYSTEMS4 = isi linux linux_dos linux_noasm linux_shlib linux_shlibz lynx
-SYSTEMS5 = maxosx macosx_gcc minix mips mpeix next next10 next2x next3x
+SYSTEMS5 = macosx macosx_gcc minix mips mpeix next next10 next2x next3x
SYSTEMS6 = nextfat osf1 pixel ptx pyramid qnxnto realix regulus rs6000 sco
SYSTEMS7 = sco_dos sco_sl sco_x286 sequent sgi solaris solaris_pkg stardent
SYSTEMS8 = stellar sunos3 sunos4 sysv sysv_gcc sysv6300 tahoe ti_sysv ultrix

OK, although I rearranged the entries a little to stay below 80 char line
width.

@@ -424,7 +424,7 @@
  @echo ""
  rm -f $(UNZIPS) $(OBJS) $(OBJF) $(OBJX) api$O apihelp$O crc_gcc$O \
    crc_sysv$O unzipstb$O crypt_.c extract_.c globals_.c inflate_.c \
-   ttyio_.c crc_i386.s msdos_.c process_.c unix_.c unzipsfx.c
+   ttyio_.c msdos_.c process_.c unix_.c unzipsfx.c
  rm -rf ./$(PKGDIR)

# Package generation interface (by J.Bush).  Originally tested under Sun

You should not remove crc_i386.s. Instead, I changed the intermediate
preprocessed
assembler file name to crc_i386s.s (here and in the sysv specific assembler
rule).



@@ -705,6 +705,12 @@
cyber_sgi: unix_make
  $(MAKE) unzips CF="$(CF) -I/usr/include/bsd"\
   LF="-lbsd $(LF)" SL="-lbsd $(SL)"
+
+cygwin:  unix_make
+ $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
+  CF="-O3 -I. -DASM_CRC $(LOC)"\
+  AF="-Di386 $(AF)" CRC32=crc_gcc\
+  E=".exe" CP="cp" LN="ln -s"

OK, but added comment that this target is not recommended.

# 680x0, DIAB dnix 5.2/5.3 (a Swedish System V clone)
#
diff -ru unz551c/unix/unix.c unzip-new/unix/unix.c
--- unz551c/unix/unix.c Sat May 10 14:11:30 2003
+++ unzip-new/unix/unix.c Mon Nov 24 11:40:00 2003
@@ -507,7 +507,7 @@
                 lastsemi = (char *)NULL; /* leave directory semi-colons 
alone */
                 break;

-#ifdef __CYGWIN__   /* CygWin runs on Win32, apply FAT/NTFS filename rules 
*/
+#ifdef __CYGWIN__   /* Cygwin runs on Win32, apply FAT/NTFS filename rules 
*/
             case ':':         /* drive spec not stored, so no colon allowed 
*/
             case '\\':        /* '\\' may come as normal filename char (not 
*/
             case '<':         /*  dir sep char!) from unix-like file system 
*/
@@ -1355,6 +1355,15 @@
#ifdef __386BSD__
       (BSD4_4 == 1)? " (386BSD, post-4.4 release)" : " (386BSD)",
#else
+#ifdef __CYGWIN__
+      " (Cygwin)",
+#else
+#if defined(i686) || defined(__i686) || defined(__i686__)
+      " (Intel 686)",
+#else
+#if defined(i586) || defined(__i586) || defined(__i586__)
+      " (Intel 586)",
+#else
#if defined(i486) || defined(__i486) || defined(__i486__)
       " (Intel 486)",
#else
@@ -1404,6 +1413,9 @@
#endif /* Pyramid */
#endif /* 386 */
#endif /* 486 */
+#endif /* 586 */
+#endif /* 686 */
+#endif /* Cygwin */
#endif /* 386BSD */
#endif /* BSDI BSD/386 */
#endif /* NetBSD */


OK.

diff -ru unz551c/unzip.h unzip-new/unzip.h
--- unz551c/unzip.h Thu May 08 19:55:42 2003
+++ unzip-new/unzip.h Sat Nov 22 18:44:00 2003
@@ -197,11 +197,12 @@
#  define MACOS
#endif

-/* use prototypes and ANSI libraries if __STDC__, or Microsoft or Borland 
C, or
- * Silicon Graphics, or Convex?, or IBM C Set/2, or GNU gcc/emx, or Watcom 
C,
- * or Macintosh, or Windows NT, or Sequent, or Atari or IBM RS/6000.
+/* use prototypes and ANSI libraries if __STDC__, or MS-DOS, or OS/2, or 
Win32,
+ * or IBM C Set/2, or Borland C, or Watcom C, or GNU gcc (emx or Cygwin),
+ * or Macintosh, or Sequent, or Atari, or IBM RS/6000, or Silicon Graphics,
+ * or Convex?, or BeOS.
  */
-#if (defined(__STDC__) || defined(MSDOS) || defined(WIN32) ||
defined(__EMX__))
+#if (defined(__STDC__) || defined(MSDOS) || defined(OS2) || defined(WIN32))
#  ifndef PROTO
#    define PROTO
#  endif
@@ -210,6 +211,14 @@
#  endif
#endif
#if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__))
+#  ifndef PROTO
+#    define PROTO
+#  endif
+#  ifndef MODERN
+#    define MODERN
+#  endif
+#endif
+#if (defined(__EMX__) || defined(__CYGWIN__))
#  ifndef PROTO
#    define PROTO
#  endif

OK.

diff -ru unz551c/unzpriv.h unzip-new/unzpriv.h
--- unz551c/unzpriv.h Sun Mar 23 16:21:26 2003
+++ unzip-new/unzpriv.h Sat Nov 22 19:55:00 2003
@@ -93,8 +93,8 @@
   -------------------------------------------------------------------------
--*/

/* Some "free" compiler distributions for Win32/i386 systems try to
- * support both Unix and Win32 environments. For Info-ZIP purpose,
- * support for the "native" file system features is prefered...
+ * support both Unix and Win32 environments.
+ * Info-ZIP prefers to support the "native" file system features...
  */
#if (defined(WIN32) && defined(UNIX))
#  undef UNIX

OK.

@@ -334,6 +334,18 @@
#  define INT_SPRINTF
#  define SYMLINKS
#  define MAIN main_stub          /* now that we're using a wrapper... */
+#endif
+
+/*-------------------------------------------------------------------------
--
+    Cygwin section:
+  -------------------------------------------------------------------------
--*/
+
+#ifdef __CYGWIN__
+#  define DIRENT
+#  define HAVE_TERMIOS_H
+#  ifndef timezone
+#    define timezone _timezone
+#  endif
#endif


/*--------------------------------------------------------------------------
-


Not accepted! This is the wrong place to add compiler-specific settings.
When this is needed, it should go into unix/unxcfg.h


diff -ru unz551c/win32/w32cfg.h unzip-new/win32/w32cfg.h
--- unz551c/win32/w32cfg.h Sat Jan 04 10:09:16 2003
+++ unzip-new/win32/w32cfg.h Sat Nov 22 19:52:30 2003
@@ -13,16 +13,11 @@
#ifndef __w32cfg_h
#define __w32cfg_h

-#if (defined(__CYGWIN32__) && !defined(__CYGWIN__))
-#  define __CYGWIN__            /* compatibility for CygWin B19 and older
*/
-#endif
-
#ifdef __CYGWIN__
-/* Those Idiots at Cygnus have started to set "Unix" identifiers
- * for a Win32 compiler ...
- */
-#  ifdef UNIX
-#    undef UNIX
+/* We regard Cygwin as a "Win32 native" file system. */
+#  undef UNIX
+#  ifndef WIN32
+#    define WIN32
#  endif
#endif

Not accepted!
This change is nonsense because you never get there unless
WIN32 was already defined!
I have accepted the removal of the pre-B19 kludge und the neccessity of a
rephrased comment.

In unzprivh.h, I have modified the section that prevents double win32/unix
environment to read as:

/* Some "free" compiler distributions for Win32/i386 systems try to
* support both Unix and Win32 environments.
*/
#if (defined(WIN32) && defined(UNIX))
#  ifdef FORCE_UNIX_OVER_WIN32
     /* UNIX emulation was explicitely requested... */
#    undef WIN32
#  else
     /* Info-ZIP prefers to support the "native" file system features... */
#    undef UNIX
#  endif
#endif

The cygwin target in unix/Makefile looks like:

# The cygwin environment on a win9x/winnt system, treated as UNIX emulator.
# Not recommended for general use:
cygwin:  unix_make
$(MAKE) unzips CC=gcc LD=gcc AS=gcc\
  CF="-O3 -I. -DUNIX -DFORCE_UNIX_OVER_WIN32 -DASM_CRC $(LOC)"\
  AF="-Di386 $(AF)" CRC32=crc_gcc\
  E=".exe" CP="cp" LN="ln -s"

These settings do now make sure that the "unix-cygwin" target does not mix 
up
unix-style i/o with win32-API calls and that unix/unxcfg.h is read in.

On my old B20 environment, I was unsuccessful in linking the "unix" variant
because of missing crtl library symbols (_ctype_, __imp__timezone)...

Best regards,

Christian Spieler

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca