mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user