Bug 146608 - net/isc-dhcp41-server: assorted dhclient path issues
Summary: net/isc-dhcp41-server: assorted dhclient path issues
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Wesley Shields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-15 05:00 UTC by Craig Leres
Modified: 2010-05-29 23:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer freebsd_triage 2010-05-15 05:00:16 UTC
	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.

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"



--------------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----hu8KkSZf4ebZjhJFuQ5xAErmOIE185h93lXGvMDBUGmrHCte
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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
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).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-05-15 05:00:27 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wxs

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2010-05-29 23:20:41 UTC
wxs         2010-05-29 22:20:30 UTC

  FreeBSD ports repository

  Modified files:
    net/isc-dhcp41-server Makefile 
    net/isc-dhcp41-server/files patch-client__Makefile.in 
  Log:
  net/isc-dhcp41-client:
   - Set the default dhclient-script and dhclient.conf properly.
  
  PR:             ports/146608
  Submitted by:   Craig Leres <leres@ee.lbl.gov>
  
  Revision  Changes    Path
  1.3       +2 -1      ports/net/isc-dhcp41-server/Makefile
  1.2       +16 -2     ports/net/isc-dhcp41-server/files/patch-client__Makefile.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Wesley Shields freebsd_committer freebsd_triage 2010-05-29 23:20:54 UTC
State Changed
From-To: open->closed

Committed. Thanks!