From rb@seagoon.gid.co.uk  Wed Feb 16 04:34:54 2000
Return-Path: <rb@seagoon.gid.co.uk>
Received: from isbalham.ist.co.uk (isbalham.ist.co.uk [192.31.26.1])
	by builder.freebsd.org (Postfix) with ESMTP id 3633C42C3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 16 Feb 2000 04:34:51 -0800 (PST)
Received: (from uucp@localhost)
	by isbalham.ist.co.uk (8.9.2/8.8.7) with UUCP id MAA15850
	for FreeBSD-gnats-submit@freebsd.org; Wed, 16 Feb 2000 12:35:21 GMT
	(envelope-from rb@seagoon.gid.co.uk)
Received: (from root@localhost)
	by seagoon.gid.co.uk (8.9.3/8.9.3) id MAA31001;
	Wed, 16 Feb 2000 12:20:16 GMT
	(envelope-from rb)
Message-Id: <200002161220.MAA31001@seagoon.gid.co.uk>
Date: Wed, 16 Feb 2000 12:20:16 GMT
From: Bob Bishop <rb@seagoon.gid.co.uk>
Reply-To: rb@seagoon.gid.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: Kernel Makefile doesn't sanitise PATH [PATCH]
X-Send-Pr-Version: 3.2

>Number:         16745
>Category:       kern
>Synopsis:       Kernel Makefile doesn't sanitise PATH [PATCH]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 16 04:40:01 PST 2000
>Closed-Date:    Sun Sep 08 03:59:52 PDT 2002
>Last-Modified:  Sun Sep 08 03:59:52 PDT 2002
>Originator:     Bob Bishop
>Release:        FreeBSD 3.4-RELEASE i386
>Organization:
GID ltd
>Environment:

	Any

>Description:

	Makefile in /sys/compile/<system> doesn't sanitise
	PATH (cf /usr/src/Makefile).  This can result in wrong
	tools being used.

>How-To-Repeat:

	sh
	echo "echo You must be joking" >/tmp/lex
	chmod +x /tmp/lex
	PATH=/tmp:$PATH export PATH
	cd /sys/i386/conf
	config GENERIC
	cd ../../compile GENERIC
	make depend; make

>Fix:

Something along the lines of:
	
--- /sys/i386/conf/Makefile.i386.orig  Wed Feb 16 12:13:07 2000
+++ /sys/i386/conf/Makefile.i386       Wed Feb 16 12:13:44 2000
@@ -19,6 +19,8 @@
 # Which version of config(8) is required.
 %VERSREQ=      300009

+PATH=   /sbin:/bin:/usr/sbin:/usr/bin
+
 KERNFORMAT?=   elf

 STD8X16FONT?=  iso


>Release-Note:
>Audit-Trail:

From: Bob Bishop <rb@gid.co.uk>
To: freebsd-gnats-submit@FreeBSD.org, rb@seagoon.gid.co.uk
Cc:  
Subject: Re: kern/16745: Kernel Makefile doesn't sanitise PATH [PATCH]
Date: Sun, 13 May 2001 10:50:32 +0100

 This problem still applies today in -CURRENT and -STABLE. The fix has
 moved, of course...
 
 
 --
 Bob Bishop              (0118) 977 4017  international code +44 118
 rb@gid.co.uk        fax (0118) 989 4254
 
 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sun Sep 8 03:57:27 PDT 2002 
State-Changed-Why:  
The kernel makefile should not fidle with the path 
it should use the tools it is told to use. 

If it did change the path the buildkernel/installkernel 
targets of src/Makefile.inc1 will not work. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=16745 
>Unformatted:
