Systemd/src/hostname
Lennart Poettering f35cb39ed6 hostname-util: rework read_hostname_config() a bit
First of all, let's rename it to read_etc_hostname(), to make clearer
what kind of configuration it actually reads: the file format defined in
/etc/hostname and nothing else.

Secondly: let's port this to use read_line(), i.e. the new way to read
lines from a file in a safe, bounded way.

Thirdly: let's strip leading/trailing whitespace from what we are
reading. Given that we are already pretty lenient what we read (comments
and empty lines), let's be permissive regarding whitespace too.

Fourthly: let's actually validate the hostname when reading it. So far
we tried to make it valid, but that's not always possible (for example,
we can't make an empty hostname valid, ever).
2017-11-20 16:43:15 +01:00
..
hostnamectl.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
hostnamed.c hostname-util: rework read_hostname_config() a bit 2017-11-20 16:43:15 +01:00
meson.build Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
org.freedesktop.hostname1.conf Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
org.freedesktop.hostname1.policy.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
org.freedesktop.hostname1.service Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00