]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-dhcp-client: validate hostnames stricter (#7308)
authorStefan Agner <falstaff@deheime.ch>
Thu, 16 Nov 2017 09:05:44 +0000 (10:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 16 Nov 2017 09:05:44 +0000 (10:05 +0100)
commit9740eae694e93b06658ff3b3045b22b591561e7c
tree4ff8e90d39b35eeac9584e960dd6c9b422d54e32
parent0c08bc7f097a5a836ec946aba1d19660fbc80997
sd-dhcp-client: validate hostnames stricter (#7308)

Technically DNS allows any ASCII character to be used in the
domain name. Also the DHCP specification for the FQDN option
(RFC 4702) does not put restriction on labels.

However, hostnames do have stricter requirements and typically
should only use characters from a-z (case insensitve), 0-9 and
minus.

Currently we require hostname/FQDN to be either a hostname or
a valid DNS name. Since dns_name_is_valid() allows any ASCII
characters this allows to specify hostnames which are typically
not valid.

Check hostname/FQDN more strictly and require them to pass both
tests. Specifically this requires the entire FQDN to be below 63.
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/test-dhcp-client.c