#include "alloc-util.h"
#include "dns-domain.h"
#include "fd-util.h"
-#include "fileio-label.h"
#include "fileio.h"
#include "ordered-set.h"
#include "resolved-conf.h"
if (stat(path, &own) >= 0 &&
st.st_dev == own.st_dev &&
st.st_ino == own.st_ino) {
- log_warning("In spite of DNSStubListner= is disabled, /etc/resolv.conf is a symlink to %s, "
- "which expects DNSStubListner= is enabled.", path);
+ log_warning("DNSStubListener= is disabled, but /etc/resolv.conf is a symlink to %s "
+ "which expects DNSStubListener= to be enabled.", path);
return -EOPNOTSUPP;
}
}
int manager_read_resolv_conf(Manager *m) {
_cleanup_fclose_ FILE *f = NULL;
struct stat st;
- char line[LINE_MAX];
unsigned n = 0;
int r;
dns_server_mark_all(m->dns_servers);
dns_search_domain_mark_all(m->search_domains);
- FOREACH_LINE(line, f, r = -errno; goto clear) {
+ for (;;) {
+ _cleanup_free_ char *line = NULL;
const char *a;
char *l;
+ r = read_line(f, LONG_LINE_MAX, &line);
+ if (r < 0) {
+ log_error_errno(r, "Failed to read /etc/resolv.conf: %m");
+ goto clear;
+ }
+ if (r == 0)
+ break;
+
n++;
l = strstrip(line);