1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

resolvconf: clear domains if nothing specified

This commit is contained in:
Yu Watanabe 2024-08-27 05:21:41 +09:00
parent b3102c05e1
commit 189cb2b15f

View File

@ -268,9 +268,16 @@ int resolvconf_parse_argv(int argc, char *argv[]) {
} else if (type == TYPE_PRIVATE)
log_debug("Private DNS server data not supported, ignoring.");
if (!arg_set_dns)
if (strv_isempty(arg_set_dns))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"No DNS servers specified, refusing operation.");
if (strv_isempty(arg_set_domain)) {
/* When no domain/search is set, clear the current domains. */
r = strv_extend(&arg_set_domain, "");
if (r < 0)
return log_oom();
}
}
return 1; /* work to do */