From 62966711010071eb61950e09bea09e092ac2d161 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 21 2021 08:07:54 +0000 Subject: import NetworkManager-1.30.0-0.7.el8 --- diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index 81b83ea..009a197 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1 +1 @@ -fe3b6df65831420d80997073c5471b6426ebed62 SOURCES/NetworkManager-1.29.8.tar.xz +154524f4020fedb98d2f159fd4cee60b139fb4ba SOURCES/NetworkManager-1.29.9.tar.xz diff --git a/.gitignore b/.gitignore index 8d3b09f..50e05b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/NetworkManager-1.29.8.tar.xz +SOURCES/NetworkManager-1.29.9.tar.xz diff --git a/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch b/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch deleted file mode 100644 index ea58f3c..0000000 --- a/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch +++ /dev/null @@ -1,219 +0,0 @@ -From 2fb5ffa8eb51add722984c6d3d465a650ea34658 Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Wed, 23 Dec 2020 14:21:21 +0100 -Subject: [PATCH 1/2] initrd: accept a zero-byte prefix for BOOTIF - -The BOOTIF MAC address can be prefixed with a hardware address -type. Typically it is 01 (for ethernet), but the legacy network module -accepts (and strips) any byte value. - -It seems wrong to take any address type without validation. In -addition to "01", also accept a zero type which, according to the -bugzilla below, is used in some configurations to mean "undefined". - -While at it, also accept ':' as separator for the first byte. - -https://bugzilla.redhat.com/show_bug.cgi?id=1904099 -https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/713 -(cherry picked from commit 6069ef4b8bb620da2329d0e60a0a8a260379d686) ---- - src/initrd/nmi-cmdline-reader.c | 23 ++++--- - src/initrd/tests/test-cmdline-reader.c | 89 +++++++++++++++----------- - 2 files changed, 66 insertions(+), 46 deletions(-) - -diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c -index 7c9982bbff7b..62891fa2cf20 100644 ---- a/src/initrd/nmi-cmdline-reader.c -+++ b/src/initrd/nmi-cmdline-reader.c -@@ -1154,14 +1154,21 @@ nmi_cmdline_reader_parse(const char *sysfs_dir, const char *const *argv, char ** - NMConnection * connection; - NMSettingWired *s_wired; - const char * bootif = bootif_val; -- -- if (!nm_utils_hwaddr_valid(bootif, ETH_ALEN) && g_str_has_prefix(bootif, "01-") -- && nm_utils_hwaddr_valid(&bootif[3], ETH_ALEN)) { -- /* -- * BOOTIF MAC address can be prefixed with a hardware type identifier. -- * "01" stays for "wired", no other are known. -- */ -- bootif += 3; -+ char prefix[4]; -+ -+ if (!nm_utils_hwaddr_valid(bootif, ETH_ALEN)) { -+ strncpy(prefix, bootif, 3); -+ prefix[3] = '\0'; -+ -+ if (NM_IN_STRSET(prefix, "01-", "01:", "00-", "00:") -+ && nm_utils_hwaddr_valid(&bootif[3], ETH_ALEN)) { -+ /* -+ * BOOTIF MAC address can be prefixed with a hardware type identifier. -+ * "01" stays for "wired", "00" is also accepted as it means "undefined". -+ * No others are known. -+ */ -+ bootif += 3; -+ } - } - - connection = reader_get_connection(reader, NULL, NM_SETTING_WIRED_SETTING_NAME, FALSE); -diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c -index 07faf96a1f5c..a809dff93c91 100644 ---- a/src/initrd/tests/test-cmdline-reader.c -+++ b/src/initrd/tests/test-cmdline-reader.c -@@ -1952,58 +1952,71 @@ static void - test_bootif_hwtype(void) - { - gs_unref_hashtable GHashTable *connections = NULL; -- const char *const *ARGV = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); -+ const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); -+ const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03"); -+ const char *const *ARGV[] = {ARGV0, ARGV1}; - NMConnection * connection; - NMSettingWired * s_wired; - NMSettingIPConfig *s_ip4; - NMSettingIPConfig *s_ip6; - gs_free char * hostname = NULL; -+ guint i; - -- connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV, &hostname); -- g_assert(connections); -- g_assert_cmpint(g_hash_table_size(connections), ==, 2); -- g_assert_cmpstr(hostname, ==, NULL); -+ for (i = 0; i < G_N_ELEMENTS(ARGV); i++) { -+ connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname); -+ g_assert(connections); -+ g_assert_cmpint(g_hash_table_size(connections), ==, 2); -+ g_assert_cmpstr(hostname, ==, NULL); - -- connection = g_hash_table_lookup(connections, "eth0"); -- g_assert(connection); -- nmtst_assert_connection_verifies_without_normalization(connection); -- g_assert_cmpstr(nm_connection_get_id(connection), ==, "eth0"); -+ connection = g_hash_table_lookup(connections, "eth0"); -+ g_assert(connection); -+ nmtst_assert_connection_verifies_without_normalization(connection); -+ g_assert_cmpstr(nm_connection_get_id(connection), ==, "eth0"); - -- s_wired = nm_connection_get_setting_wired(connection); -- g_assert(!nm_setting_wired_get_mac_address(s_wired)); -- g_assert(s_wired); -+ s_wired = nm_connection_get_setting_wired(connection); -+ g_assert(!nm_setting_wired_get_mac_address(s_wired)); -+ g_assert(s_wired); - -- s_ip4 = nm_connection_get_setting_ip4_config(connection); -- g_assert(s_ip4); -- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); -- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); -- g_assert(!nm_setting_ip_config_get_may_fail(s_ip4)); -+ s_ip4 = nm_connection_get_setting_ip4_config(connection); -+ g_assert(s_ip4); -+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), -+ ==, -+ NM_SETTING_IP4_CONFIG_METHOD_AUTO); -+ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); -+ g_assert(!nm_setting_ip_config_get_may_fail(s_ip4)); - -- s_ip6 = nm_connection_get_setting_ip6_config(connection); -- g_assert(s_ip6); -- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO); -- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); -+ s_ip6 = nm_connection_get_setting_ip6_config(connection); -+ g_assert(s_ip6); -+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), -+ ==, -+ NM_SETTING_IP6_CONFIG_METHOD_AUTO); -+ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); - -- connection = g_hash_table_lookup(connections, "bootif_connection"); -- g_assert(connection); -- nmtst_assert_connection_verifies_without_normalization(connection); -- g_assert_cmpstr(nm_connection_get_id(connection), ==, "BOOTIF Connection"); -+ connection = g_hash_table_lookup(connections, "bootif_connection"); -+ g_assert(connection); -+ nmtst_assert_connection_verifies_without_normalization(connection); -+ g_assert_cmpstr(nm_connection_get_id(connection), ==, "BOOTIF Connection"); - -- s_wired = nm_connection_get_setting_wired(connection); -- g_assert_cmpstr(nm_setting_wired_get_mac_address(s_wired), ==, "00:53:AB:CD:02:03"); -- g_assert(s_wired); -+ s_wired = nm_connection_get_setting_wired(connection); -+ g_assert_cmpstr(nm_setting_wired_get_mac_address(s_wired), ==, "00:53:AB:CD:02:03"); -+ g_assert(s_wired); - -- s_ip4 = nm_connection_get_setting_ip4_config(connection); -- g_assert(s_ip4); -- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); -- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); -- g_assert(nm_setting_ip_config_get_may_fail(s_ip4)); -+ s_ip4 = nm_connection_get_setting_ip4_config(connection); -+ g_assert(s_ip4); -+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), -+ ==, -+ NM_SETTING_IP4_CONFIG_METHOD_AUTO); -+ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); -+ g_assert(nm_setting_ip_config_get_may_fail(s_ip4)); - -- s_ip6 = nm_connection_get_setting_ip6_config(connection); -- g_assert(s_ip6); -- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO); -- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); -- g_assert(nm_setting_ip_config_get_may_fail(s_ip6)); -+ s_ip6 = nm_connection_get_setting_ip6_config(connection); -+ g_assert(s_ip6); -+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), -+ ==, -+ NM_SETTING_IP6_CONFIG_METHOD_AUTO); -+ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); -+ g_assert(nm_setting_ip_config_get_may_fail(s_ip6)); -+ } - } - - /* Check that nameservers are assigned to all existing --- -2.29.2 - - -From 9ad933ab1496178adf8d7f987fc0612f36f87c00 Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Thu, 14 Jan 2021 20:59:34 +0100 -Subject: [PATCH 2/2] initrd: fix leak in test - -Fixes: 6069ef4b8bb6 ('initrd: accept a zero-byte prefix for BOOTIF') -(cherry picked from commit 07ee187cb52f1ca6f975ae41bd56042bfd4b1ec1) ---- - src/initrd/tests/test-cmdline-reader.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c -index a809dff93c91..0c3014607c83 100644 ---- a/src/initrd/tests/test-cmdline-reader.c -+++ b/src/initrd/tests/test-cmdline-reader.c -@@ -1951,18 +1951,19 @@ test_bootif_no_ip(void) - static void - test_bootif_hwtype(void) - { -- gs_unref_hashtable GHashTable *connections = NULL; - const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); - const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03"); - const char *const *ARGV[] = {ARGV0, ARGV1}; -- NMConnection * connection; -- NMSettingWired * s_wired; -- NMSettingIPConfig *s_ip4; -- NMSettingIPConfig *s_ip6; -- gs_free char * hostname = NULL; - guint i; - - for (i = 0; i < G_N_ELEMENTS(ARGV); i++) { -+ gs_unref_hashtable GHashTable *connections = NULL; -+ NMConnection * connection; -+ NMSettingWired * s_wired; -+ NMSettingIPConfig * s_ip4; -+ NMSettingIPConfig * s_ip6; -+ gs_free char * hostname = NULL; -+ - connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname); - g_assert(connections); - g_assert_cmpint(g_hash_table_size(connections), ==, 2); --- -2.29.2 - diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index e6bfe7f..b95fa7b 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -6,8 +6,8 @@ %global epoch_version 1 %global rpm_version 1.30.0 -%global real_version 1.29.8 -%global release_version 0.6 +%global real_version 1.29.9 +%global release_version 0.7 %global snapshot %{nil} %global git_sha %{nil} @@ -191,7 +191,6 @@ Patch1: 0001-cloud-setup-systemd-unit-rh1791758.patch # Bugfixes that are only relevant until next rebase of the package. # Patch1000: some.patch -Patch1000: 1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch # The pregenerated docs contain default values and paths that depend # on the configure options when creating the source tarball. @@ -224,6 +223,7 @@ Conflicts: NetworkManager-pptp < 1:0.7.0.99-1 Conflicts: NetworkManager-openconnect < 0:0.7.0.99-1 Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 +BuildRequires: make BuildRequires: gcc BuildRequires: libtool BuildRequires: pkgconfig @@ -384,6 +384,12 @@ Summary: Wifi plugin for NetworkManager Group: System Environment/Base Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 9 +Requires: wireless-regdb +%else +Requires: crda +%endif + %if %{with iwd} && (0%{?fedora} > 24 || 0%{?rhel} > 7) Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd) Suggests: wpa_supplicant @@ -821,7 +827,7 @@ intltoolize --automake --copy --force --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ --with-config-logging-backend-default=%{logging_backend_default} -make %{?_smp_mflags} +%make_build %endif @@ -829,7 +835,7 @@ make %{?_smp_mflags} %if %{with meson} %meson_install %else -make install DESTDIR=%{buildroot} +%make_install %endif cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/ @@ -895,8 +901,12 @@ fi %post -/usr/bin/udevadm control --reload-rules || : -/usr/bin/udevadm trigger --subsystem-match=net || : +# skip triggering if udevd isn't even accessible, e.g. containers or +# rpm-ostree-based systems +if [ -S /run/udev/control ]; then + /usr/bin/udevadm control --reload-rules || : + /usr/bin/udevadm trigger --subsystem-match=net || : +fi %if %{with firewalld_zone} %firewalld_reload %endif @@ -1003,7 +1013,8 @@ fi %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man7/nmcli-examples.7* -%{_mandir}/man8/* +%{_mandir}/man8/nm-initrd-generator.8.gz +%{_mandir}/man8/NetworkManager.8.gz %dir %{_localstatedir}/lib/NetworkManager %dir %{_sysconfdir}/sysconfig/network-scripts %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service @@ -1143,6 +1154,10 @@ fi %changelog +* Tue Jan 19 2021 Thomas Haller - 1:1.30.0-0.7 +- Update to 1.29.9 (development) +- By default check all devices for hostname reverse DNS lookup (rh #1766944) + * Thu Jan 14 2021 Thomas Haller - 1:1.30.0-0.6 - Update to 1.29.8 (development) - initrd: accept zero-byte prefix for BOOTIF MAC address (rh #1904099)