[Dnsmasq-discuss] lease list format and embedded spaces

Simon Kelley simon at thekelleys.org.uk
Mon Jul 9 09:14:54 BST 2007


richardvoigt at gmail.com wrote:
> Since the lease list file uses a space as a delimiter (as does the output
> from external-script init), it looks like names containing spaces aren't
> handled correctly.  Actually, it looks like dnsmasq stops reading the host
> file after the first line with too many columns.


Hmm, an interesting can of worms. My first reaction to this was "it's
not a problem, spaces are not legal in hostnames and should never get
there", but when I looked at the code, two things are apparent.

1) Hostnames in --dhcp-host lines are not ever checked for legality:
that's a bug. They are checked elsewhere (/etc/ethers, /etc/hosts, DHCP
client supplied names....)

2) The "is this hostname legal" checker actually allows spaces. This was
a change made to allow SRV records for DNS-SD, which have to have
spaces. The implications for the DHCP lease system were missed.

My inclination is to re-impose the ban on spaces on DHCP hostnames.
Richard, would that cause you problems? Presumably you have at least one
name with a space in it, is that "real" or from an all-possibilites test?

If spaces in hostnames are to be allowed, they should be escaped somehow.

Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list