Update to 1.41.91 release (release candidate)

Resolves: #2019306
This commit is contained in:
Lubomir Rintel 2023-01-26 10:16:15 +01:00
parent 653c67569a
commit 1aa10acfaf
7 changed files with 306 additions and 51 deletions

1
.gitignore vendored
View File

@ -425,3 +425,4 @@ network-manager-applet-0.8.1.tar.bz2
/NetworkManager-1.41.7.tar.xz
/NetworkManager-1.41.8.tar.xz
/NetworkManager-1.41.90.tar.xz
/NetworkManager-1.41.91.tar.xz

View File

@ -0,0 +1,29 @@
From e2246cb54b35604c6b203e3398fa8d5735b60567 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 12 Sep 2022 13:17:34 +0200
Subject: [PATCH 1/3] dns-manager: style fix
(cherry picked from commit f2f806f77d96b2094a23ef1c67a9f07bd8ae6fff)
---
src/core/dns/nm-dns-manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index ea02d4f7c8..457b82a098 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -1311,9 +1311,9 @@ _collect_resolv_conf_data(NMDnsManager *self,
priv = NM_DNS_MANAGER_GET_PRIVATE(self);
- if (global_config)
+ if (global_config) {
merge_global_dns_config(&rc, global_config);
- else {
+ } else {
nm_auto_str_buf NMStrBuf tmp_strbuf = NM_STR_BUF_INIT(0, FALSE);
int first_prio = 0;
const NMDnsConfigIPData *ip_data;
--
2.39.1

View File

@ -0,0 +1,35 @@
From 164cc81569283e3c27478e39a3a8ec65e2ff34ca Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 12 Sep 2022 13:47:35 +0200
Subject: [PATCH 2/3] config-data: style fix
(cherry picked from commit 051819a78e6d2c4b4a5a158f78a50e1ff524fe9c)
---
src/core/nm-config-data.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/core/nm-config-data.c b/src/core/nm-config-data.c
index 61cf111894..1504b15659 100644
--- a/src/core/nm-config-data.c
+++ b/src/core/nm-config-data.c
@@ -1125,10 +1125,13 @@ load_global_dns(GKeyFile *keyfile, gboolean internal)
gboolean default_found = FALSE;
char **strv;
- group =
- internal ? NM_CONFIG_KEYFILE_GROUP_INTERN_GLOBAL_DNS : NM_CONFIG_KEYFILE_GROUP_GLOBAL_DNS;
- domain_prefix = internal ? NM_CONFIG_KEYFILE_GROUPPREFIX_INTERN_GLOBAL_DNS_DOMAIN
- : NM_CONFIG_KEYFILE_GROUPPREFIX_GLOBAL_DNS_DOMAIN;
+ if (internal) {
+ group = NM_CONFIG_KEYFILE_GROUP_INTERN_GLOBAL_DNS;
+ domain_prefix = NM_CONFIG_KEYFILE_GROUPPREFIX_INTERN_GLOBAL_DNS_DOMAIN;
+ } else {
+ group = NM_CONFIG_KEYFILE_GROUP_GLOBAL_DNS;
+ domain_prefix = NM_CONFIG_KEYFILE_GROUPPREFIX_GLOBAL_DNS_DOMAIN;
+ }
domain_prefix_len = strlen(domain_prefix);
if (!nm_config_keyfile_has_global_dns_config(keyfile, internal))
--
2.39.1

View File

@ -0,0 +1,231 @@
From 4d75c43f1a12840b940bf0a327d5664db84b9c1c Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 12 Sep 2022 13:21:51 +0200
Subject: [PATCH 3/3] dns-manager: always apply options from [global-dns]
Currently, the use of [global-dns] section for setting DNS options is
conditioned on presence of a nameserver in a [global-dns-domain-*] section.
Attempt to use the section for options alone results in an error:
[global-dns]
options=timeout:1
Or via D-Bus API:
# busctl set-property org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager org.freedesktop.NetworkManager \
GlobalDnsConfiguration 'a{sv}' 2 \
"options" as 1 "timeout:1" \
"domains" a{sv} 0
...
Nov 24 13:15:21 zmok.local NetworkManager[501184]: <debug> [1669292121.3904]
manager: set global DNS failed with error: Global
DNS configuration is missing the default domain
The insistence on existence of [global-dns-domain-*] would make sense if
other [global-dns-domain-...] sections were present.
However, the user might only want to set the options in resolv.conf and
still use connection-provide nameservers for the actual resolving.
Lift the limitation by allowing the [global-dns] to be used alone, while
still insist on [global-dns-domain-*] being there in presence of other
domain-specific options.
https://bugzilla.redhat.com/show_bug.cgi?id=2019306
(cherry picked from commit 1f0d1d78d2a28ef82764a801c344e22816b06f67)
---
Makefile.am | 2 +
src/core/dns/nm-dns-manager.c | 41 +++++++++----------
src/core/nm-config-data.c | 2 +-
src/core/tests/config/global-dns-good.conf | 13 ++++++
src/core/tests/config/global-dns-options.conf | 5 +++
src/core/tests/config/test-config.c | 16 +++++++-
6 files changed, 55 insertions(+), 24 deletions(-)
create mode 100644 src/core/tests/config/global-dns-good.conf
create mode 100644 src/core/tests/config/global-dns-options.conf
diff --git a/Makefile.am b/Makefile.am
index aa79967e1b..3d43c010a7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4497,7 +4497,9 @@ EXTRA_DIST += \
src/core/tests/config/NetworkManager-warn.conf \
src/core/tests/config/NetworkManager.state \
src/core/tests/config/bad.conf \
+ src/core/tests/config/global-dns-good.conf \
src/core/tests/config/global-dns-invalid.conf \
+ src/core/tests/config/global-dns-options.conf \
src/core/tests/config/conf.d/00-overrides.conf \
src/core/tests/config/conf.d/10-more.conf \
src/core/tests/config/conf.d/20-config-enable-1.conf \
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index 457b82a098..42519e64fe 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -1201,7 +1201,8 @@ compute_hash(NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer[
if (global)
nm_global_dns_config_update_checksum(global, sum);
- else {
+
+ if (!global || !nm_global_dns_config_lookup_domain(global, "*")) {
const CList *head;
/* FIXME(ip-config-checksum): this relies on the fact that an IP
@@ -1244,13 +1245,15 @@ merge_global_dns_config(NMResolvConfData *rc, NMGlobalDnsConfig *global_conf)
}
default_domain = nm_global_dns_config_lookup_domain(global_conf, "*");
- nm_assert(default_domain);
+ if (!default_domain)
+ return TRUE;
servers = nm_global_dns_domain_get_servers(default_domain);
- if (servers) {
- for (i = 0; servers[i]; i++)
- add_string_item(rc->nameservers, servers[i], TRUE);
- }
+ if (!servers)
+ return TRUE;
+
+ for (i = 0; servers[i]; i++)
+ add_string_item(rc->nameservers, servers[i], TRUE);
return TRUE;
}
@@ -1311,9 +1314,10 @@ _collect_resolv_conf_data(NMDnsManager *self,
priv = NM_DNS_MANAGER_GET_PRIVATE(self);
- if (global_config) {
+ if (global_config)
merge_global_dns_config(&rc, global_config);
- } else {
+
+ if (!global_config || !nm_global_dns_config_lookup_domain(global_config, "*")) {
nm_auto_str_buf NMStrBuf tmp_strbuf = NM_STR_BUF_INIT(0, FALSE);
int first_prio = 0;
const NMDnsConfigIPData *ip_data;
@@ -2556,14 +2560,12 @@ config_changed_cb(NMConfig *config,
}
}
-static GVariant *
-_get_global_config_variant(NMGlobalDnsConfig *global)
+static void
+_get_global_config_variant(GVariantBuilder *builder, NMGlobalDnsConfig *global)
{
NMGlobalDnsDomain *domain;
- GVariantBuilder builder;
guint i, num;
- g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
num = nm_global_dns_config_get_num_domains(global);
for (i = 0; i < num; i++) {
GVariantBuilder conf_builder;
@@ -2599,10 +2601,8 @@ _get_global_config_variant(NMGlobalDnsConfig *global)
"priority",
g_variant_new_int32(NM_DNS_PRIORITY_DEFAULT_NORMAL));
- g_variant_builder_add(&builder, "a{sv}", &conf_builder);
+ g_variant_builder_add(builder, "a{sv}", &conf_builder);
}
-
- return g_variant_ref_sink(g_variant_builder_end(&builder));
}
static GVariant *
@@ -2619,15 +2619,12 @@ _get_config_variant(NMDnsManager *self)
if (priv->config_variant)
return priv->config_variant;
- global_config = nm_config_data_get_global_dns_config(nm_config_get_data(priv->config));
- if (global_config) {
- priv->config_variant = _get_global_config_variant(global_config);
- _LOGT("current configuration: %s", (str = g_variant_print(priv->config_variant, TRUE)));
- return priv->config_variant;
- }
-
g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+ global_config = nm_config_data_get_global_dns_config(nm_config_get_data(priv->config));
+ if (global_config)
+ _get_global_config_variant(&builder, global_config);
+
head = _mgr_get_ip_data_lst_head(self);
c_list_for_each_entry (ip_data, head, ip_data_lst) {
GVariantBuilder entry_builder;
diff --git a/src/core/nm-config-data.c b/src/core/nm-config-data.c
index 1504b15659..c6ab998f94 100644
--- a/src/core/nm-config-data.c
+++ b/src/core/nm-config-data.c
@@ -1233,7 +1233,7 @@ load_global_dns(GKeyFile *keyfile, gboolean internal)
default_found = TRUE;
}
- if (!default_found) {
+ if (!default_found && g_hash_table_size(dns_config->domains)) {
nm_log_dbg(LOGD_CORE,
"%s global DNS configuration is missing default domain, ignore it",
internal ? "internal" : "user");
diff --git a/src/core/tests/config/global-dns-good.conf b/src/core/tests/config/global-dns-good.conf
new file mode 100644
index 0000000000..6265a611cf
--- /dev/null
+++ b/src/core/tests/config/global-dns-good.conf
@@ -0,0 +1,13 @@
+# Good configuration, since there is a default domain section
+
+[global-dns]
+searches=foo.com
+options=timeout:5
+
+[global-dns-domain-*]
+servers=4.5.6.7
+options=myoption1
+
+[global-dns-domain-test.com]
+servers=1.2.3.4
+options=myoption2
diff --git a/src/core/tests/config/global-dns-options.conf b/src/core/tests/config/global-dns-options.conf
new file mode 100644
index 0000000000..0be1773525
--- /dev/null
+++ b/src/core/tests/config/global-dns-options.conf
@@ -0,0 +1,5 @@
+# Good configuration, since there is no domain section
+
+[global-dns]
+searches=foo.com
+options=timeout:5
diff --git a/src/core/tests/config/test-config.c b/src/core/tests/config/test-config.c
index fa7fae0757..054b9003f4 100644
--- a/src/core/tests/config/test-config.c
+++ b/src/core/tests/config/test-config.c
@@ -370,7 +370,21 @@ test_config_global_dns(void)
g_object_unref(config);
- /* Check that a file without a default domain section gives a NULL configuration */
+ /* Check that a file with a default domain section gives a good configuration */
+ config =
+ setup_config(NULL, TEST_DIR "/global-dns-good.conf", "", NULL, "/no/such/dir", "", NULL);
+ dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config));
+ g_assert(dns);
+ g_object_unref(config);
+
+ /* Check that a file with options but no domains gives a good configuration */
+ config =
+ setup_config(NULL, TEST_DIR "/global-dns-options.conf", "", NULL, "/no/such/dir", "", NULL);
+ dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config));
+ g_assert(dns);
+ g_object_unref(config);
+
+ /* Check that a file with a domain domain, but without a default one gives a NULL configuration */
config =
setup_config(NULL, TEST_DIR "/global-dns-invalid.conf", "", NULL, "/no/such/dir", "", NULL);
dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config));
--
2.39.1

View File

@ -4,7 +4,7 @@
%global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
%global epoch_version 1
%global real_version 1.41.90
%global real_version 1.41.91
%global rpm_version %{real_version}
%global release_version 1
%global snapshot %{nil}
@ -194,6 +194,9 @@ Source7: readme-ifcfg-rh.txt
# Bugfixes that are only relevant until next rebase of the package.
# Patch1001: 1001-some.patch
Patch1: 0001-dns-manager-style-fix.patch
Patch2: 0002-config-data-style-fix.patch
Patch3: 0003-dns-manager-always-apply-options-from-global-dns.patch
Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8
@ -1229,6 +1232,11 @@ fi
%changelog
* Thu Jan 26 2023 Lubomir Rintel <lkundrak@v3.sk> - - 1:1.41.91-1
- Update to 1.41.91 release (release candidate)
- core: retry if a rtnetlink socket runs out of buffer space (rh #2154350)
- dns: allow changing resolv.conf options alone via global-dns (rh #2019306)
* Fri Jan 20 2023 Fernando Fernandez Mancera <ferferna@redhat.com> - 1:1.41.90-1
- Update to 1.41.90 release (release candidate)
- l3cfg: schedule an update after every commit-type/config-data register/unregister (rh #2158394)

View File

@ -1,49 +0,0 @@
#
# rpminspect configuration file
#
# *** INTERNAL SETTINGS FOR RED HAT -- DO NOT REDISTRIBUTE ***
#
#XXX In order to tweak the rpminspect configuration per component, the
#XXX default configuration file can be obtained from
#XXX https://gitlab.cee.redhat.com/osci/rpminspect-data-redhat/-/blob/master/redhat.yaml
---
badfuncs:
# Shared function names prohibited from executables and libraries.
# The function names listed here are generally ones provided by
# the system, but are deprecated in favor of more modern
# alternatives. As a rule we do not want to make use of those but
# only provide them to users for backwards compatibility.
# This is an array of forbidden function names.
- gethostbyname
- gethostbyname2
- gethostbyaddr
- inet_addr
#XXX NetworkManager intentionally uses inet_aton. It does so in a controlled manner
#XXX to parse IPv4 addresses in the legacy style (with leading zeros, which inet_pton() does
#XXX not support). See https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/cf1b726157c36f72a79aa1276c8c80fe2be1d04d/src/libnm-glib-aux/nm-shared-utils.c#L911
#XXX
#XXX - inet_aton
- inet_nsap_addr
- inet_ntoa
- inet_nsap_ntoa
- inet_makeaddr
- inet_netof
- inet_network
- inet_neta
- inet_net_ntop
- inet_net_pton
- rcmd
- rexec
- rresvport
# Optional list of glob(7) specifications to match files to ignore
# for this inspection. The format of this list is the same as the
# global 'ignore' list. The difference is the items specified
# here will only be used during this inspection.
#ignore:
# - /usr/lib*/libexample.so*

View File

@ -1 +1 @@
SHA512 (NetworkManager-1.41.90.tar.xz) = 49d717868d7a1aae305b2ef2f384f0a63cd2d7ac723dadf31012cf504f8c471e5145460c60f605c927bfa4362f7a7d6a5d9ebf824097c04ed44774db8b894e20
SHA512 (NetworkManager-1.41.91.tar.xz) = 178b29e73c0490139dee9b07f36ed03e8970558613d6309f9e0de57b992cf2f0263b460a423d632ca99d6d0ff6cbc48442ce366a9bcbcba1d44cc2a571b3d550