Thoughts on dhcp-client automatically determining the hostname?

Jeffrey Hutzelman jhutz at cmu.edu
Mon Feb 11 21:16:35 UTC 2008


--On Monday, February 11, 2008 08:18:00 PM +0100 Olaf van der Spek 
<olafvdspek at gmail.com> wrote:

> On Feb 11, 2008 6:49 PM, David W. Hankins <David_Hankins at isc.org> wrote:
>> On Mon, Feb 11, 2008 at 05:50:38PM +0100, Olaf van der Spek wrote:
>> > I agree. Are there plans to implement it?
>>
>> it's not as easy as doing the hostname() built-in function, so there
>> are no plans for a pipe-like thing i'm aware of.
>
> Given that exec is already implemented, wouldn't it be quite simple to
> extend this code to also support stdout?

No; "run a program and collect its output" is consideraby more work than 
just "run a program".  The output-collecting part is a bit tricky to get 
right, especially if you want to handle a program that may fork children 
which never exit (leaving the pipe open).  Programs may produce arbitrary 
output, so you have to be prepared to allocate memory to put it in and/or 
set limits on the amount of output that will be collected.  And so on.

>> > It'd still be nice if the host name was send by default though. What
>> > are the disadvantages of doing that?
>>
>> it's essentially a leakage of privacy information, so i'm
>> uncomfortable with making that decision in the code.  this is the sort
>> of thing that should be decided in integrating the dhclient into an
>> OS; who is your user and what do they expect?
>
> But some Linux distributions would prefer not to deviate from upstream
> (too much).

Some things require every integrator to make a decision.  Configuring 
dhclient is one of these cases - the correct configuration depends on how 
the distribution manages network interfaces, which varies widely from one 
distribution to the next.  There is no one-size-fits-all answer.

And, as David points out, if there's going to be an upstream default, it 
should be to preserve privacy whenever possible, rather than giving away as 
much information as possible.


More information about the dhcp-users mailing list