chiark / gitweb /
hostname: Allow comments in /etc/hostname
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 19 May 2015 05:49:56 +0000 (07:49 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 08:57:17 +0000 (09:57 +0100)
commit2e69dc3b6967982d9cfc35bd55d34a2358c6a99e
treeb97bea48a134879d3737320e7e33cd01cfbffe6d
parent18c5e189569c5ff06c54dd901ae5d5406696f433
hostname: Allow comments in /etc/hostname

The hostname(1) tool allows comments in /etc/hostname. Introduce a new
read_hostname_config() in hostname-util which reads a hostname configuration
file like /etc/hostname, strips out comments, whitespace, and cleans the
hostname. Use it in hostname-setup.c and hostnamed and remove duplicated code.

Update hostname manpage. Add tests.

https://launchpad.net/bugs/1053048
src/shared/hostname-util.c
src/shared/hostname-util.h