[pkg-dhcp-devel] Bug#628141: Bug#628141: patch that should fix the isue

Andrew Pollock apollock at debian.org
Sat Jun 18 17:23:33 UTC 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-dhcp-devel/attachments/20110618/ef9c9027/attachment.pgp>


More information about the pkg-dhcp-devel mailing list