diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-27 17:47:00 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-03-02 12:43:12 +0100 |
commit | b351c300ee4b3f0cdd50fe3dc4eab9abd931b438 (patch) | |
tree | 5652f9ca5f5c55401a05d4dc8848cbee9a9e38ac | |
parent | man: extend synopsys to recently added commands (diff) | |
download | systemd-b351c300ee4b3f0cdd50fe3dc4eab9abd931b438.tar.xz systemd-b351c300ee4b3f0cdd50fe3dc4eab9abd931b438.zip |
resolved: debug log about resolv.conf lines we don't grok
-rw-r--r-- | src/resolve/resolved-resolv-conf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c index bad04d6a29..c828e9201f 100644 --- a/src/resolve/resolved-resolv-conf.c +++ b/src/resolve/resolved-resolv-conf.c @@ -68,6 +68,7 @@ int manager_read_resolv_conf(Manager *m) { _cleanup_fclose_ FILE *f = NULL; struct stat st; char line[LINE_MAX]; + unsigned n = 0; int r; assert(m); @@ -118,8 +119,10 @@ int manager_read_resolv_conf(Manager *m) { const char *a; char *l; + n++; + l = strstrip(line); - if (IN_SET(*l, '#', ';')) + if (IN_SET(*l, '#', ';', 0)) continue; a = first_word(l, "nameserver"); @@ -139,6 +142,8 @@ int manager_read_resolv_conf(Manager *m) { if (r < 0) log_warning_errno(r, "Failed to parse search domain string '%s', ignoring.", a); } + + log_syntax(NULL, LOG_DEBUG, "/etc/resolv.conf", n, 0, "Ignoring resolv.conf line: %s", l); } m->resolv_conf_mtime = timespec_load(&st.st_mtim); |