Subject: Re: bin/3138: [dM] mkdep(1) always uses /usr/bin/gcc
To: Chris G. Demetriou <cgd@CS.cmu.edu>
From: Todd Vierling <tv@pobox.com>
List: netbsd-bugs
Date: 02/01/1997 11:33:04
On Fri, 31 Jan 1997, Chris G. Demetriou wrote:

: > [ ... ]
: > + if [ "$CC" = "" ]; then
: > + 	CC=`which cc`
: > + 	if [ "$CC" = "" ]; then
: > + 		CC=`which gcc`
: > [ ... ]
: 
: use of 'which' is a fatal flaw in this patch.

Funny; I don't see why.  If you're worried about security, that's one thing
(a root user should know his $PATH--this isn't setuid); if you're worried
about compatibility, there should be no problem using which.  The binary
/usr/bin/which (which sh uses, instead of csh's builtin) works as this
script uses it; if it finds cc/gcc, it prints only the first instance, and
if it doesn't, it prints nothing. 

=====
== Todd Vierling (Personal tv@pobox.com; Business tv@iag.net) Mmmm, donuts ==
== System administrator/technician, Internet Access Group, Orlando Florida ==
== Dialups in Orange, Volusia, Lake, Osceola counties - http://www.iag.net ==