From 4345042e2b43d0ca5f0c99b03429a29ec5f37304c640cc74eebe74cd94ac0080 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Wed, 23 Jul 2014 09:23:13 +0000 Subject: [PATCH] Accepting request 241979 from home:rmilasan:branches:Base:System - Enable better checks in write_net_rules to skip adding duplicated entries in the generate rules (bnc#888178). Add 1053-better-checks-in-write_net_rules.patch - Enable better checks in write_net_rules to skip adding duplicated entries in the generate rules (bnc#888178). Add 1053-better-checks-in-write_net_rules.patch OBS-URL: https://build.opensuse.org/request/show/241979 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=726 --- 1053-better-checks-in-write_net_rules.patch | 29 +++++++++++++++++++++ systemd-mini.changes | 7 +++++ systemd-mini.spec | 3 +++ systemd.changes | 7 +++++ systemd.spec | 3 +++ 5 files changed, 49 insertions(+) create mode 100644 1053-better-checks-in-write_net_rules.patch diff --git a/1053-better-checks-in-write_net_rules.patch b/1053-better-checks-in-write_net_rules.patch new file mode 100644 index 00000000..50e03693 --- /dev/null +++ b/1053-better-checks-in-write_net_rules.patch @@ -0,0 +1,29 @@ +Index: systemd-210/src/udev/rule_generator/write_net_rules +=================================================================== +--- systemd-210.orig/src/udev/rule_generator/write_net_rules ++++ systemd-210/src/udev/rule_generator/write_net_rules +@@ -89,6 +89,12 @@ choose_rules_file + + # the DRIVERS key is needed to not match bridges and VLAN sub-interfaces + if [ "$MATCHADDR" ]; then ++ # Check if MACADDR doesn't exist already in the generated rules ++ MAC="$(/usr/bin/grep -w -o -C1 -m1 "$MATCHADDR" "$RULES_FILE" 2>/dev/null || true)" ++ if [ "$MAC" == "$MATCHADDR" ]; then ++ unlock_rules_file ++ exit 0 ++ fi + match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\"" + fi + +@@ -101,8 +107,9 @@ if [ "$MATCHDEVID" ]; then + fi + + if [ "$MATCHID" ]; then +- ID="$(find_all_rules 'KERNELS==' "$MATCHID")" +- if [ "$ID" == "$MATCHID" ]; then ++ # Check if KERNEL doesn't exist already in the generated rules ++ KERNEL="$(find_all_rules 'KERNELS==' "$MATCHID")" ++ if [ "$KERNEL" == "$MATCHID" ]; then + unlock_rules_file + exit 0 + fi diff --git a/systemd-mini.changes b/systemd-mini.changes index 8a67cd87..bd231f90 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jul 23 09:19:52 UTC 2014 - rmilasan@suse.com + +- Enable better checks in write_net_rules to skip adding duplicated + entries in the generate rules (bnc#888178). + Add 1053-better-checks-in-write_net_rules.patch + ------------------------------------------------------------------- Wed Jul 23 09:13:43 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 9524345e..821ddb1c 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -835,6 +835,8 @@ Patch1050: 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patc Patch1051: 1051-check-if-NAME-has-a-value.patch # PATCH-FIX-UPSTREAM 1052-rules-uaccess-add-ID_SOFTWARE_RADIO.patch Patch1052: 1052-rules-uaccess-add-ID_SOFTWARE_RADIO.patch +# PATCH-FIX-SUSE 1053-better-checks-in-write_net_rules.patch (bnc#888178) +Patch1053: 1053-better-checks-in-write_net_rules.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -1407,6 +1409,7 @@ cp %{SOURCE7} m4/ %patch1050 -p1 %patch1051 -p1 %patch1052 -p0 +%patch1053 -p1 # ensure generate files are removed rm -f units/emergency.service diff --git a/systemd.changes b/systemd.changes index 8a67cd87..bd231f90 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jul 23 09:19:52 UTC 2014 - rmilasan@suse.com + +- Enable better checks in write_net_rules to skip adding duplicated + entries in the generate rules (bnc#888178). + Add 1053-better-checks-in-write_net_rules.patch + ------------------------------------------------------------------- Wed Jul 23 09:13:43 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 523fee99..0e5ecf3a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -830,6 +830,8 @@ Patch1050: 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patc Patch1051: 1051-check-if-NAME-has-a-value.patch # PATCH-FIX-UPSTREAM 1052-rules-uaccess-add-ID_SOFTWARE_RADIO.patch Patch1052: 1052-rules-uaccess-add-ID_SOFTWARE_RADIO.patch +# PATCH-FIX-SUSE 1053-better-checks-in-write_net_rules.patch (bnc#888178) +Patch1053: 1053-better-checks-in-write_net_rules.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -1402,6 +1404,7 @@ cp %{SOURCE7} m4/ %patch1050 -p1 %patch1051 -p1 %patch1052 -p0 +%patch1053 -p1 # ensure generate files are removed rm -f units/emergency.service