Systemd/src
Zbigniew Jędrzejewski-Szmek bd00527779 resolved: rework parsing of /etc/hosts
Do not treat various errors (missing hostname, invalid address) as fatal,
just warn and continue. /etc/hosts is written by humans and we should not
reject the whole file just because a singly entry is not to our liking.

Handle comments as described in hosts(5):
everything from the comment character until the end of the line should be
ignored.

Fixes #10779.

Add tests.
2018-12-10 09:56:56 +01:00
..
ac-power coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
activate coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
analyze Merge pull request #11041 from yuwata/update-missing-v2 2018-12-04 16:19:02 +01:00
ask-password coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
backlight tree-wide: port various places over to STARTSWITH_SET() 2018-11-26 14:08:46 +01:00
basic socket-util: Let's trick out ubsan when it validate struct sockaddr_un.sun_path[] 2018-12-04 23:28:14 +01:00
binfmt coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
boot tree-wide: drop redundant space between __attribute__ and (( 2018-12-03 13:28:26 +01:00
busctl json: add new display flag JSON_FORMAT_COLOR_AUTO 2018-12-03 22:42:38 +01:00
cgls coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
cgroups-agent log: introduce new helper call log_setup_service() 2018-11-20 11:18:22 +01:00
cgtop cgtop: use SWAP_TWO() macro 2018-12-02 12:06:07 +01:00
core Merge pull request #11041 from yuwata/update-missing-v2 2018-12-04 16:19:02 +01:00
coredump util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
cryptsetup cryptsetup-generator: define main through macro 2018-12-02 12:18:54 +01:00
debug-generator coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
delta coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
detect-virt coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
dissect coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
environment-d-generator util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
escape coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
firstboot util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
fsck basic/main-func: propagate all positive return values 2018-11-20 16:48:21 +01:00
fstab-generator Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00
fuzz util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
getty-generator generators: drop umask calls 2018-11-21 13:40:24 +01:00
gpt-auto-generator Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00
hibernate-resume coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
hostname util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
hwdb Split out pretty-print.c and move pager.c and main-func.h to shared/ 2018-11-20 18:40:02 +01:00
id128 coccinelle: also mark previous synthetic errnos as such 2018-11-22 10:54:38 +01:00
import util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
initctl coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
journal tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
journal-remote util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
kernel-install kernel-install: teach bot loader spec entry generator to generate entries with "tries" 2018-10-19 22:34:50 +02:00
libsystemd tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
libsystemd-network util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
libudev libudev: drop unnecessary check 2018-11-23 09:16:11 +01:00
locale Merge pull request #11041 from yuwata/update-missing-v2 2018-12-04 16:19:02 +01:00
login Merge pull request #11041 from yuwata/update-missing-v2 2018-12-04 16:19:02 +01:00
machine Merge pull request #11042 from yuwata/tiny-coding-style-fixes 2018-12-04 16:15:09 +01:00
machine-id-setup coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
modules-load modules-load: use static destructor and DEFINE_MAIN_FUNCTION() macro 2018-11-20 18:40:02 +01:00
mount Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00
network util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
notify coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
nspawn util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
nss-myhostname nss: do not modify errno when NSS_STATUS_NOTFOUND or NSS_STATUS_SUCCESS 2018-07-25 10:23:22 +02:00
nss-mymachines Merge pull request #9504 from poettering/nss-deadlock 2018-07-26 10:16:25 +02:00
nss-resolve Merge pull request #9504 from poettering/nss-deadlock 2018-07-26 10:16:25 +02:00
nss-systemd nss: do not modify errno when NSS_STATUS_NOTFOUND or NSS_STATUS_SUCCESS 2018-07-25 10:23:22 +02:00
partition Merge pull request #10996 from poettering/oci-prep 2018-11-30 10:09:00 +01:00
path coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
portable tree-wide: specify all table headers in lower-case 2018-12-03 22:42:38 +01:00
quotacheck coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
random-seed coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
rc-local-generator rc-local-generator: provide more debugging information 2018-11-27 15:24:07 +01:00
remount-fs coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
reply-password log: introduce new helper call log_setup_service() 2018-11-20 11:18:22 +01:00
resolve resolved: rework parsing of /etc/hosts 2018-12-10 09:56:56 +01:00
rfkill rfkill: define main through macro 2018-11-23 06:22:30 +09:00
run tree-wide: port various places over to STARTSWITH_SET() 2018-11-26 14:08:46 +01:00
run-generator add new run-generator 2018-11-27 09:44:40 +01:00
shared Merge pull request #11041 from yuwata/update-missing-v2 2018-12-04 16:19:02 +01:00
sleep coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
socket-proxy socket-proxy: define main through macro 2018-11-23 06:22:30 +09:00
stdio-bridge coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
sulogin-shell log: introduce new helper call log_setup_service() 2018-11-20 11:18:22 +01:00
sysctl coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
system-update-generator generators: drop umask calls 2018-11-21 13:40:24 +01:00
systemctl tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
systemd tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
sysusers Merge pull request #10920 from yuwata/hashmap-destructor 2018-12-03 17:59:44 +01:00
sysv-generator generators: drop umask calls 2018-11-21 13:40:24 +01:00
test test-dns-domain: print function names 2018-12-05 12:34:57 +01:00
time-wait-sync time-wait: define main through macro 2018-11-23 06:22:30 +09:00
timedate util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
timesync coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
tmpfiles tmpfiles: define main through macro 2018-12-02 12:18:54 +01:00
tty-ask-password-agent coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
udev util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
update-done update-done: quit earlier on failure 2018-11-23 06:22:30 +09:00
update-utmp update-utmp: use _cleanup_ attribute to finalize process 2018-11-23 06:22:30 +09:00
user-sessions tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
vconsole util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
veritysetup veritysetup-generator: use static destructors and define main through macro 2018-11-23 06:22:30 +09:00
volatile-root Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00