config: fix a reversed conditional

This effectively makes [*global-dns-domain-*] sections in configuration be
ignored unless [*global-dns] is also present. This happens because
nm_config_keyfile_has_global_dns_config() mixes the group names up and
attempts to loop up [.intern.global-dns-domain-*] in user configuration and
[global-dns-domain-*] in the internal one.

Fixes: da0ded4927 ('config: drop global-dns.enable option in favor of .config.enable')
(cherry picked from commit de1c06daab)
(cherry picked from commit bd4f5333e8)
This commit is contained in:
Lubomir Rintel 2022-09-12 13:17:50 +02:00
parent f3ceba65f4
commit c6685f0179

View file

@ -1509,8 +1509,8 @@ nm_config_keyfile_has_global_dns_config(GKeyFile *keyfile, gboolean internal)
if (!keyfile)
return FALSE;
if (g_key_file_has_group(keyfile,
internal ? NM_CONFIG_KEYFILE_GROUP_GLOBAL_DNS
: NM_CONFIG_KEYFILE_GROUP_INTERN_GLOBAL_DNS))
internal ? NM_CONFIG_KEYFILE_GROUP_INTERN_GLOBAL_DNS
: NM_CONFIG_KEYFILE_GROUP_GLOBAL_DNS))
return TRUE;
groups = g_key_file_get_groups(keyfile, NULL);