From owner-freebsd-arch Sun Feb 3 15:39: 3 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailgate.originative.co.uk (mailgate.originative.co.uk [62.232.68.68]) by hub.freebsd.org (Postfix) with ESMTP id 7DAF837B41D for ; Sun, 3 Feb 2002 15:38:56 -0800 (PST) Received: from lobster.originative.co.uk (lobster [62.232.68.81]) by mailgate.originative.co.uk (Postfix) with ESMTP id 9E60A1D169; Sun, 3 Feb 2002 23:38:54 +0000 (GMT) Subject: Re: install(1) to use a cross strip(1) From: Paul Richards To: Marcel Moolenaar Cc: arch@FreeBSD.org In-Reply-To: <20020201231306.A670@dhcp01.pn.xcllnt.net> References: <20020201231306.A670@dhcp01.pn.xcllnt.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0 (Preview Release) Date: 03 Feb 2002 23:38:54 +0000 Message-Id: <1012779534.18110.0.camel@lobster.originative.co.uk> Mime-Version: 1.0 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 2002-02-02 at 07:13, Marcel Moolenaar wrote: > Gang, > > As part of doing cross development with our source tree I hit upon > the nasty habit of install(1) to want to use strip(1) and specificly > by that name. To make my live easier, I have made install(1) look > for an envvar first. Is this kind of flexibility generic enough to > have it committed? > > --- xinstall.c 19 Dec 2001 06:05:42 -0000 1.47 > +++ xinstall.c 27 Jan 2002 08:54:51 -0000 > @@ -702,6 +702,7 @@ > strip(to_name) > const char *to_name; > { > + char *stripbin; > int serrno, status; > > switch (fork()) { > @@ -711,7 +712,10 @@ > errno = serrno; > err(EX_TEMPFAIL, "fork"); > case 0: > - execlp("strip", "strip", to_name, (char *)NULL); > + stripbin = getenv("STRIPBIN"); > + if (stripbin == NULL) > + stripbin = "strip"; > + execlp(stripbin, stripbin, to_name, (char *)NULL); > err(EX_OSERR, "exec(strip)"); > default: > if (wait(&status) == -1 || status) { It's strikes me as being to risky from a security perspective. You'd have to be really sure that there wasn't a trojan generator masquerading as STRIPBIN. Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message