On Sat, Jun 18, 2011 at 06:36:23PM +0200, Peter Marschall wrote: > Hi Andrew, > > Tomas has a point here. > While the part regarding the invalid variables was fixed in 4.1.1-17, > the logic still looks a bit fishy: > "only set the host name if the old one and the new one are given" > (I am aware that I am the one to blame ;-)
You may be, but I'm not convinced this kind of logic belongs in dhclient-script in the first place. > Please find attached a patch that hopefully fixes the issue for good: > Here's the logic it tries to implement: > > For the non-udeb case, set the hostname in Linux & kfreebsd only if > 1) the new hostname isn't empty > <=> make sure that we do not reset the hostname to empty > > 2) the current hostname is empty (or '(none)' or 'localhost') or > matches the old hostname from DHCP > <=> make sure that we only set the host name if there is > no valid one or if the old hostname came from DHCP too > > 3) the current hostname is empty or > the new hostname from DHCP differs from the old one from DHCP > <=> make sure that we set the host name only if it really changed > > If you think it is the correct solution, please consider including it in the > next release of isc-dhcp for Debian As I've said on this bug and another, I really think the best solution if you don't want DHCP to be determining your hostname is to not request it in the first place, not to have some tricky logic in dhclient-script itself to try and infer the intent of the local administrator. regards Andrew
signature.asc
Description: Digital signature