core: dbus: accept global DNS configuration without a default domain

Since 1.44 we accept a global-dns section without any global-dns-domain
section, so users can define searches and options without defining any
global DNS servers.

When set from the D-Bus API it was still rejected. Fix it.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
This commit is contained in:
Íñigo Huguet 2025-08-20 08:28:01 +02:00
parent 05efc6e253
commit 294131a2a4

View file

@ -1606,17 +1606,6 @@ nm_global_dns_config_from_dbus(const GValue *value, GError **error)
g_variant_unref(val);
}
/* An empty value is valid and clears the internal configuration */
if (!nm_global_dns_config_is_empty(dns_config)
&& !nm_global_dns_config_lookup_domain(dns_config, "*")) {
g_set_error_literal(error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
"Global DNS configuration is missing the default domain");
nm_global_dns_config_free(dns_config);
return NULL;
}
global_dns_config_seal_domains(dns_config);
return dns_config;
}