Hello community,

here is the log from the commit of package openvswitch for openSUSE:Factory 
checked in at 2020-06-23 21:05:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openvswitch (Old)
 and      /work/SRC/openSUSE:Factory/.openvswitch.new.2956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openvswitch"

Tue Jun 23 21:05:16 2020 rev:50 rq:816321 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/openvswitch/openvswitch.changes  2020-06-04 
17:56:58.353102473 +0200
+++ /work/SRC/openSUSE:Factory/.openvswitch.new.2956/openvswitch.changes        
2020-06-23 21:05:48.278076806 +0200
@@ -1,0 +2,11 @@
+Mon Jun 15 13:21:22 UTC 2020 - Jaime CaamaƱo Ruiz <[email protected]>
+
+- Fix preserving old default OVS_USER_ID for users that removed the
+  override at /etc/sysconfig/openvswitch or for users affected by
+  fillup bug below (bsc#1172861).
+- Add patch to workaround a possible fillup issue that could cause
+  existing openvswitch configuration to be unintendedly altered during
+  upgrades (bsc#1172929).
+  * 0001-Use-double-hash-for-OVS_USER_ID-comment.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Use-double-hash-for-OVS_USER_ID-comment.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openvswitch.spec ++++++
--- /var/tmp/diff_new_pack.Ic0L7i/_old  2020-06-23 21:05:48.830078590 +0200
+++ /var/tmp/diff_new_pack.Ic0L7i/_new  2020-06-23 21:05:48.834078602 +0200
@@ -68,6 +68,8 @@
 Patch2:         0001-Don-t-change-permissions-of-dev-hugepages.patch
 # PATCH-FIX-UPSTREAM: 0001-rhel-Fix-reload-of-OVS_USER_ID-on-startup.patch
 Patch3:         0001-rhel-Fix-reload-of-OVS_USER_ID-on-startup.patch
+# PATCH-FIX-OPENSUSE: 0001-Use-double-hash-for-OVS_USER_ID-comment.patch
+Patch4:         0001-Use-double-hash-for-OVS_USER_ID-comment.patch
 #OVN patches
 # PATCH-FIX-OPENSUSE: 0001-Run-ovn-as-openvswitch-openvswitch.patch
 Patch20:        0001-Run-ovn-as-openvswitch-openvswitch.patch
@@ -387,6 +389,7 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 cd %{ovn_dir}
 %patch20 -p1
 
@@ -825,19 +828,47 @@
     systemctl enable openvswitch.service
 fi
 
+ovsdbdir_regex="^[[:space:]]*OVS_DBDIR[[:space:]]*="
+ovsuserid_regex="^[[:space:]]*OVS_USER_ID[[:space:]]*="
+ovsvar_valueregex="[^=]*=[[:space:]]*["'"'"']{0,1}([^"'"'"']*)["'"'"']{0,1}[[:space:]]*$"
+conf="%{_sysconfdir}/sysconfig/openvswitch"
+ovsdbdir=$(grep -E "${ovsdbdir_regex}" "${conf}" | tail -1 | sed -E --posix 
's|'"${ovsvar_valueregex}"'|\1|')
+ovsuserid=$(grep -E "${ovsuserid_regex}" "${conf}" | tail -1 | sed -E --posix 
's|'"${ovsvar_valueregex}"'|\1|')
+
 # Default DB path changed from /etc/openvswitch to /var/lib/openvswitch.
 # But try to keep the old path for upgraded users already making use of it.
-ovsdbpid=$(systemctl is-active --quiet ovsdb-server && systemctl show -p 
MainPID --value ovsdb-server || echo 0)
-if [ $ovsdbpid -gt 0 ] && [ -n "$(find /proc/$ovsdbpid/fd/ -type l -lname 
'%{_sysconfdir}/openvswitch/conf.db')" ]; then
+if [ -z "$ovsdbdir" ]; then
+    ovsdbpid=$(systemctl is-active --quiet ovsdb-server && systemctl show -p 
MainPID --value ovsdb-server || echo 0)
+    if [ $ovsdbpid -gt 0 ] && [ -n "$(find /proc/$ovsdbpid/fd/ -type l -lname 
'%{_sysconfdir}/openvswitch/conf.db')" ]; then
     # We have ovsdb-server pid from the unit file with DB open at the old path.
-    # If we did not override OVS_DBDIR already, do it.
-    if ! grep -qE "^OVS_DBDIR=" %{_sysconfdir}/sysconfig/openvswitch; then
-        sed -i -e '1{r /dev/stdin' -e 'N}' 
%{_sysconfdir}/sysconfig/openvswitch << EOF
+        ovsdbdir="%{_sysconfdir}/openvswitch"
+        sed -i -e '1{r /dev/stdin' -e 'N}' 
"%{_sysconfdir}/sysconfig/openvswitch" << EOF
+
 # OVS_DBDIR was automatically inserted here on openvswitch package upgrade to
 # preserve the currently used /etc/openvswitch as the database directory.
 # Note that new installs use /var/lib/openvswitch as the default database
 # directory by omission.
-OVS_DBDIR=%{_sysconfdir}/openvswitch
+OVS_DBDIR="%{_sysconfdir}/openvswitch"
+
+EOF
+    fi
+fi
+
+# Default OVS user changed from root:root to openvswitch:openvswitch.
+# But try to keep root:root for upgraded users already making use of it.
+# Use .conf.db.~lock~ instead of conf.db as conf.db might have been moved
+# to a backup on a previous run attempt.
+if [ -z "$ovsuserid" -a -n "$ovsdbdir" -a -f "$ovsdbdir/.conf.db.~lock~" ]; 
then
+    ovsuserid=$(stat -c "%U:%G" "$ovsdbdir/.conf.db.~lock~")
+    if [ "$ovsuserid" = "root:root" ]; then
+        sed -i -e '1{r /dev/stdin' -e 'N}' 
"%{_sysconfdir}/sysconfig/openvswitch" << EOF
+
+# OVS_USER_ID was automatically inserted here on openvswitch package upgrade to
+# preserve the currently used root:root as the openvswitch running credentials.
+# Note that new installs use openvswitch:openvswitch as the default openvswitch
+# running credentials by omission.
+OVS_USER_ID="root:root"
+
 EOF
     fi
 fi

++++++ 0001-Use-double-hash-for-OVS_USER_ID-comment.patch ++++++
>From e007ba2d276530db6aa8a242b069f356395cd8e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= <[email protected]>
Date: Mon, 15 Jun 2020 15:15:53 +0200
Subject: [PATCH] Use double hash for OVS_USER_ID comment

---
 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template 
b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
index c467d02db..10b841679 100644
--- a/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
+++ b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
@@ -28,4 +28,4 @@
 OPTIONS=""
 
 # Uncomment and set the OVS User/Group value
-#OVS_USER_ID="openvswitch:openvswitch"
+## OVS_USER_ID="openvswitch:openvswitch"
-- 
2.26.1


Reply via email to