Subject: bin/11996: Dhclient-script uses arp and sed before they are available
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kivinen@ssh.fi>
List: netbsd-bugs
Date: 01/18/2001 12:33:19
>Number:         11996
>Category:       bin
>Synopsis:       Dhclient-script uses arp and sed from the /usr before usr is mounted
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 18 12:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Tero Kivinen
>Release:        NetBSD 1.5
>Organization:
SSH Communications Security
>Environment:
System: NetBSD banaani.hel.fi.ssh.com 1.5 NetBSD 1.5 (SSH) #0: Tue Jan 2 23:32:28 EET 2001 root@banaani.ssh.fi:/usr/src/sys/arch/i386/compile/SSH i386


>Description:

	If I fetch ip-address using dhclient on the boot, the
	dhclient-script will print out ugly error messages complaining
	that sed and arp are not found. This is because they are in
	the /usr/sbin, and dhclient is run before the /usr is mounted. 

>How-To-Repeat:

	Configure dhclient=YES, but leave the rest of the
	configuration as default. The boot will print out "arp: not
	found" and "sed: not found" error messages. 

>Fix:

	Add check that arp and sed are available before using them,
	i.e modify the dhclient-script line:

	    arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh

	to be

	   if [ -f /usr/sbin/arp ]; then
	     arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh
	   fi

	I don't think that piece of code is needed at all when getting
	the initial ip-address. 
>Release-Note:
>Audit-Trail:
>Unformatted: