From owner-freebsd-bugs Wed Jan 30 13:10:19 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3DEA137B423 for ; Wed, 30 Jan 2002 13:10:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0ULA2394068; Wed, 30 Jan 2002 13:10:02 -0800 (PST) (envelope-from gnats) Date: Wed, 30 Jan 2002 13:10:02 -0800 (PST) Message-Id: <200201302110.g0ULA2394068@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "brian j. peterson" Subject: Re: misc/34455: [PATCH] /sbin/dhclient-script overwrites /etc/resolv.conf without any relevant information Reply-To: "brian j. peterson" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/34455; it has been noted by GNATS. From: "brian j. peterson" To: FreeBSD-gnats-submit@freebsd.org Cc: Ceri Subject: Re: misc/34455: [PATCH] /sbin/dhclient-script overwrites /etc/resolv.conf without any relevant information Date: Wed, 30 Jan 2002 14:04:31 -0700 On Wed, Jan 30, 2002 at 06:28:07PM +0000, Ceri wrote: > Strikes me as pilot error to be honest. > If the DCHP server doesn't provide nameservers, and you're not overriding them, > then you'll end up with nothing there. > > If you wish to insert some information into /etc/resolv.conf, > that's what the supersede statement in dhclient.conf is for, viz. > > # cat /etc/dhclient.conf > interface "ed0" { > supersede domain-name "private.submonkey.net"; > prepend domain-name-servers 192.168.10.1; > } admittedly, there are ways around this problem, but the fact is that dhclient-script is overwriting /etc/resolv.conf regardless of whether or not it has useful data to write to it. my trivial patch solves this problem by not writing to /etc/resolv.conf if there's no reason to. (the script simply checks to see if a certain variable has a value or not, and writes to /etc/resolv.conf only if the variable has a value.) i prefer, at this point, to create my own /etc/resolv.conf, and since i'm not requesting any domain-name or domaina-name-servers information, i don't think dhclient-script has any business overwriting /etc/resolv.conf with "search \n". am i wrong to expect this script to not clobber important files with useless information? -brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message