From: David Hankins Date: Thu, 26 Apr 2007 19:31:58 +0000 (+0000) Subject: - dhclient now closes its descriptor to dhclient.leases prior to executing X-Git-Tag: v4_0_0a1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d97a043e42cb0145fd849559ae0bfaf01b9cfb3;p=thirdparty%2Fdhcp.git - dhclient now closes its descriptor to dhclient.leases prior to executing dhclient-script. Thanks to a patch from Tomas Pospisek. [ISC-Bugs #16728] --- diff --git a/RELNOTES b/RELNOTES index 4d0084d11..c3ea5073a 100644 --- a/RELNOTES +++ b/RELNOTES @@ -199,6 +199,11 @@ the README file. - Encapsulated option spaces within encapsulated option spaces is now formally supported. +*** for merge +- dhclient now closes its descriptor to dhclient.leases prior to executing + dhclient-script. Thanks to a patch from Tomas Pospisek. +*** + Changes since 3.0.5 - A logic error in omapi interface code was repaired that might result in diff --git a/client/dhclient.c b/client/dhclient.c index 0870e07fd..c3324b08b 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -32,7 +32,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.145 2007/04/03 14:57:53 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.146 2007/04/26 19:31:58 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -2650,6 +2650,11 @@ int script_go (client) wstatus = 0; } } else { + /* We don't want to pass an open file descriptor for + * dhclient.leases when executing dhclient-script. + */ + if (leaseFile != NULL) + fclose(leaseFile); execve (scriptName, argv, envp); log_error ("execve (%s, ...): %m", scriptName); exit (0);