From hohmuth@irs201.inf.tu-dresden.de  Tue Aug  1 09:57:52 1995
Received: from irs201.inf.tu-dresden.de ([141.76.16.201])
          by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id JAA00503
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 1 Aug 1995 09:56:25 -0700
Received: (from hohmuth@localhost) by irs201.inf.tu-dresden.de (8.6.11/8.6.9) id SAA01632; Tue, 1 Aug 1995 18:56:04 +0200
Message-Id: <199508011656.SAA01632@irs201.inf.tu-dresden.de>
Date: Tue, 1 Aug 1995 18:56:04 +0200
From: hohmuth@inf.tu-dresden.de
Reply-To: hohmuth@inf.tu-dresden.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: "install -c -s" can't install shell scripts
X-Send-Pr-Version: 3.2

>Number:         645
>Category:       bin
>Synopsis:       "install -c -s" can't install shell scripts
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug  1 10:00:01 PDT 1995
>Closed-Date:    Fri Aug 4 19:14:41 MET DST 1995
>Last-Modified:  Fri Aug  4 19:15:08 MET DST 1995
>Originator:     Michael Hohmuth
>Release:        FreeBSD 2.0.5-RELEASE i386
>Organization:
Dept. of Computer Science, TU Dresden, Germany
>Environment:

uname -a yields:

    FreeBSD olymp.inf.tu-dresden.de 2.0.5-RELEASE FreeBSD 2.0.5-RELEASE #0: Wed Jul  5 12:39:10  1995 root@olymp.inf.tu-dresden.de:/usr/src/sys/compile/OLYMP  i386

>Description:

When invoked with "-s", `install' executes `strip' in order to strip
the installed file.  However, if the file can't be stripped (for
example, if it is a shell script), `strip' will return an exit code != 0
which make `install' delete the destination file.  `install' will
return exit code 0 nevertheless.  (The file installs OK when "-s" is
omitted.)

I believe that `install' should silently ignore failure codes returned
by `strip' and should not delete the destination file.

>How-To-Repeat:

Here's a typescript:

    olymp:~> echo baz > foo
    olymp:~> install -c -s foo bar
    strip: bar: Inappropriate file type or format
    olymp:~> cat bar
    cat: bar: No such file or directory
    olymp:~> install -c foo bar
    olymp:~> cat bar
    baz

>Fix:
	
--- usr.bin/xinstall/xinstall.c~	Fri May 27 14:33:39 1994
+++ usr.bin/xinstall/xinstall.c	Fri Jul 28 01:40:17 1995
@@ -311,7 +311,7 @@
 		execl(_PATH_STRIP, "strip", to_name, NULL);
 		err("%s: %s", _PATH_STRIP, strerror(errno));
 	default:
-		if (wait(&status) == -1 || status)
+		if (wait(&status) == -1)
 			(void)unlink(to_name);
 	}
 }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Fri Aug 4 19:14:41 MET DST 1995 
State-Changed-Why:  
Suggested fix applied in rev 1.2 of xinstall.c. 

>Unformatted:
 
