Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 1997 22:45:06 +0200 (CEST)
From:      Dag-Erling Coidan Smørgrav <finrod@pugwash.priv.no>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   gnu/4220: gzexe does not detect all dependencies
Message-ID:  <199708032045.WAA03339@pugwash.priv.no>
Resent-Message-ID: <199708032050.NAA16362@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4220
>Category:       gnu
>Synopsis:       gzexe does not detect all dependencies
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug  3 13:50:01 PDT 1997
>Last-Modified:
>Originator:     Dag-Erling Coidan Smørgrav
>Organization:
University of Oslo, Department of Informatics
>Release:        FreeBSD 2.2.1-RELEASE i386
>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.
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708032045.WAA03339>