From finrod@pugwash.priv.no  Sun Aug  3 13:45:49 1997
Received: from pugwash.priv.no (messepc2.eunet.no [195.1.8.2])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA16117
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 3 Aug 1997 13:45:46 -0700 (PDT)
Received: (from finrod@localhost)
	by pugwash.priv.no (8.8.5/8.8.5) id WAA03339;
	Sun, 3 Aug 1997 22:45:06 +0200 (CEST)
Message-Id: <199708032045.WAA03339@pugwash.priv.no>
Date: Sun, 3 Aug 1997 22:45:06 +0200 (CEST)
From: Dag-Erling Coidan Smrgrav <finrod@pugwash.priv.no>
Reply-To: finrod@pugwash.priv.no
To: FreeBSD-gnats-submit@freebsd.org
Subject: gzexe does not detect all dependencies
X-Send-Pr-Version: 3.2

>Number:         4220
>Category:       gnu
>Synopsis:       gzexe does not detect all dependencies
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug  3 13:50:01 PDT 1997
>Closed-Date:    Sat Aug 9 08:35:22 PDT 1997
>Last-Modified:  Sat Aug  9 08:37:01 PDT 1997
>Originator:     Dag-Erling Coidan Smrgrav
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
University of Oslo, Department of Informatics
>Environment:

	gzip 1.2.4 (18 Aug 93)
	Compilation options:
	DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H ASMV 

>Description:

	The gzexe shell script, which is used to create self-extracting
	compressed executables, does not detect its own dependency on
	/bin/sh, and will attempt to compress it if asked. It does however
	detect dependency on chmod, rm, sleep etc. and refuses to compress
	them.

	If you attempt to compress /bin/* to conserve space on a system
	with a small disk (in my case, a printer server with a 120 MB
	disk), gzexe will trash sh, which makes it impossible to uncom-
	press and use any other compressed binary (e.g. cp, in order to
	'cp sh~ sh')

	It is also possible that the same problem exists for echo and sed
	(which are used by the decompression script, but not checked for
	by gzexe)

>How-To-Repeat:

	# gzexe /bin/sh
	Segmentation fault - core dumped

>Fix:

	Run this shell script as root:
	
#!/bin/sh
patch -n `which gzexe` - <<EOF
77c77
<   gzip | tail | chmod | ln | sleep | rm)
---
>   sh | gzip | tail | chmod | ln | sleep | rm)
EOF

	This will cause gzexe to check if you are trying to compress sh.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Sat Aug 9 08:35:22 PDT 1997 
State-Changed-Why:  
Suggested fix applied, thanks! src/gnu/usr.bin/gzip/gzexe rev 1.5 
>Unformatted:
