From: Yu Watanabe Date: Tue, 8 Aug 2023 18:00:34 +0000 (+0900) Subject: resolve: ignore nameserver= and domain= kernel command line options without value X-Git-Tag: v255-rc1~787^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91acee9906e973365109b1b1d5e880ced9aeae65;p=thirdparty%2Fsystemd.git resolve: ignore nameserver= and domain= kernel command line options without value Otherwise, manager_parse_dns_server_string_and_warn() or manager_parse_search_domains_and_warn() will trigger assertion. --- diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c index 3a67a4747e4..94a579275fd 100644 --- a/src/resolve/resolved-conf.c +++ b/src/resolve/resolved-conf.c @@ -518,6 +518,10 @@ static int proc_cmdline_callback(const char *key, const char *value, void *data) * interpret, for example dracut and SUSE Linux. */ if (proc_cmdline_key_streq(key, "nameserver")) { + + if (proc_cmdline_value_missing(key, value)) + return 0; + if (!info->dns_server_unlinked) { /* The kernel command line overrides any prior configuration */ dns_server_unlink_all(manager_get_first_dns_server(info->manager, DNS_SERVER_SYSTEM)); @@ -532,6 +536,9 @@ static int proc_cmdline_callback(const char *key, const char *value, void *data) } else if (proc_cmdline_key_streq(key, "domain")) { + if (proc_cmdline_value_missing(key, value)) + return 0; + if (!info->search_domain_unlinked) { dns_search_domain_unlink_all(info->manager->search_domains); info->search_domain_unlinked = true;