ports/146608: net/isc-dhcp41-server: assorted dhclient path issues

Craig Leres leres at ee.lbl.gov
Sat May 15 04:00:17 UTC 2010


>Number:         146608
>Category:       ports
>Synopsis:       net/isc-dhcp41-server: assorted dhclient path issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 15 04:00:16 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Craig Leres
>Release:        FreeBSD 7.2-RELEASE amd64
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
	FreeBSD hot.ee.lbl.gov 7.2-RELEASE FreeBSD 7.2-RELEASE #9: Mon May 10
15:36:44 PDT 2010
leres at hot.ee.lbl.gov:/usr/src/7.2-RELEASE/sys/amd64/compile/LBLSMPIPV6
amd64

>Description:
	There are several path issues that make using the dhcp
	4.1.1 version of dhclient difficult to use.

	Since the port does not set the configure prefix the path,
	_PATH_DHCLIENT_SCRIPT gets set to /sbin/dhclient-script
	instead of /usr/local/sbin/dhclient-script.

	Another configure prefix problem is that the path installed
	in dhclient-script's run-time environment (CLIENT_PATH),
	is set to "/sbin". But since this string is used an an
	execve() environment vector element and is missing the
	leading "PATH=" (probably a bug with dhcp 4.1.1) the
	dhclient-script ends up with the default path of
	"/usr/bin:/bin". Either way this means common programs
	used by the dhclient-script script are not on the path.

>How-To-Repeat:
	Run dhclient and notice that although the package installs
	/usr/local/sbin/dhclient-script it invokes /sbin/dhclient-script
	and that the script emits errors such as "route: not found" (see
	attachment lose1.txt).

>Fix:
	Run configure with the correct --prefix and set the the
	dhclient script and config paths. Also, set CLIENT_PATH to
	include /sbin and /usr/sbin (and add missing "PATH="); see
	attached patches.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvuGkAACgkQWxlAhAje3JtdFACfXvTe4isZQ2PPK0LgKAKbX2JR
NYwAmQEwCnzpdDhIoyXV21RTgEU8WBOh
=LGGh
-----END PGP SIGNATURE-----

--------------020708050901070306090206
Content-Type: text/plain;
 name="lose1.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lose1.txt"

fire 1 # which dhclient
/usr/local/sbin/dhclient
fire 2 # dhclient em0
dhclient: New IP Address (em0): 172.16.1.100
dhclient: New Subnet Mask (em0): 255.255.255.0
dhclient: New Broadcast Address (em0): 172.16.1.255
dhclient: New Routers (em0): 172.16.1.1
route: not found
route: not found
route: not found
chown: not found
fire 3 # ls -tul /sbin/dhclient-script /usr/local/sbin/dhclient-script
-r-xr-xr-x  1 root  wheel   9475 May 14 20:10 /sbin/dhclient-script
-rwxr-xr-x  1 root  wheel  11012 May  8 15:06 /usr/local/sbin/dhclient-script
fire 4 # 


--------------020708050901070306090206
Content-Type: text/plain;
 name="patch-Makefile.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-Makefile.txt"

--- Makefile-	2010-05-06 13:24:01.000000000 -0700
+++ Makefile	2010-05-14 18:26:30.000000000 -0700
@@ -52,6 +52,8 @@
 
 MAN_COMPRESSED=	no
 GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--prefix=/usr/local
+CONFIGURE_ENV=	CPPFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/usr/local/sbin/dhclient-script\"' -D_PATH_DHCLIENT_CONF='\"/usr/local/etc/dhclient.conf\"'"
 SCRIPTS_ENV+=	PKG_PREFIX=${PREFIX}
 
 .if ${SUBSYS} == client


--------------020708050901070306090206
Content-Type: text/plain;
 name="patch-files-patch-client__Makefile.in.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-files-patch-client__Makefile.in.txt"

1,2c1,2
< --- ./client/Makefile.in.orig	2010-01-07 19:47:06.000000000 -0500
< +++ ./client/Makefile.in	2010-05-02 20:38:26.000000000 -0400
---
> --- ./client/Makefile.in.orig	2010-01-07 16:47:06.000000000 -0800
> +++ ./client/Makefile.in	2010-05-14 18:14:56.000000000 -0700
13a14,27
> @@ -537,11 +537,11 @@
>  
>  
>  dhclient.o: dhclient.c
> -	$(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
> +	$(COMPILE) -DCLIENT_PATH='"PATH=/sbin:/usr/sbin:$(sbindir)"' \
>  		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
>  
>  dhc6.o: dhc6.c
> -	$(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
> +	$(COMPILE) -DCLIENT_PATH='"PATH=/sbin:/usr/sbin:$(sbindir)"' \
>  		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
>  # Tell versions [3.59,3.63) of GNU make to not export all variables.
>  # Otherwise a system limit (for SysV at least) may be exceeded.


--------------020708050901070306090206
Content-Type: application/octet-stream;
 name="lose1.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="lose1.txt.sig"

iEYEABECAAYFAkvuGkAACgkQWxlAhAje3JuAXQCfcDw6gm86i0RXET27u9FJ/haSQ40Anjwf
kDmclBJWDcSLexPXDknxeD7p
--------------020708050901070306090206
Content-Type: application/octet-stream;
 name="patch-Makefile.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="patch-Makefile.txt.sig"

iEYEABECAAYFAkvuGkAACgkQWxlAhAje3JuFLQCeII+y7+f0VZnBJiznTOE6GRxt084AoIYo
hKvsRCQmK89c14Jr3halgU3Q
--------------020708050901070306090206
Content-Type: application/octet-stream;
 name="patch-files-patch-client__Makefile.in.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="patch-files-patch-client__Makefile.in.txt.sig"

iEYEABECAAYFAkvuGkAACgkQWxlAhAje3JtL2wCbB4AQ9XooCafkPxXVAKnPfL82nBkAnA21
w8UIXeHC7M2iTEhl2fwDH8pZ
--------------020708050901070306090206--
>Release-Note:
>Audit-Trail:
>Unformatted:
 This is a multi-part message in MIME format.
 --------------020708050901070306090206
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 



More information about the freebsd-ports-bugs mailing list