From 91acee9906e973365109b1b1d5e880ced9aeae65 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Aug 2023 03:00:34 +0900 Subject: [PATCH] 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. --- src/resolve/resolved-conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c index 3a67a4747e..94a579275f 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; -- 2.25.1