From owner-freebsd-bugs Sun Aug 3 13:50:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA16368 for bugs-outgoing; Sun, 3 Aug 1997 13:50:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA16362; Sun, 3 Aug 1997 13:50:02 -0700 (PDT) Resent-Date: Sun, 3 Aug 1997 13:50:02 -0700 (PDT) Resent-Message-Id: <199708032050.NAA16362@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, finrod@pugwash.priv.no 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 ; 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 Smørgrav Reply-To: finrod@pugwash.priv.no To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: gnu/4220: gzexe does not detect all dependencies Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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` - < sh | gzip | tail | chmod | ln | sleep | rm) EOF This will cause gzexe to check if you are trying to compress sh. >Audit-Trail: >Unformatted: