[ovs-dev] [PATCH 2/2] xenserver: Verify md5sums of XenServer host scripts.

Ben Pfaff blp at nicira.com
Mon Jan 16 20:33:10 UTC 2012


Commit 34edeccfd8d (xenserver: Remove support for XenServer versions older
than 5.6 FP1.) stopped verifying the md5sums of the XenServer-owned host
scripts that the Open vSwitch RPM replaces.  This commit restores that
behavior, as a small guard against future changes.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
Not yet tested.

 xenserver/openvswitch-xen.spec |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index 56db2e5..e3b46da 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -1,6 +1,6 @@
 # Spec file for Open vSwitch.
 
-# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012 Nicira Networks, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -129,6 +129,38 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
 rm -rf $RPM_BUILD_ROOT
 
 %post
+if test "$1" = 1; then
+    if md5sum -c --status <<EOF
+21f85db25599d7f026cd489385d58aa6  /opt/xensource/libexec/interface-reconfigure
+9d493545ae81463239d3162cbc798852  /opt/xensource/libexec/InterfaceReconfigureBridge.py
+395866df1b0b20c12c4dd2f7de0ecdb4  /opt/xensource/libexec/InterfaceReconfigure.py
+862d0939b441de9264a900628e950fe9  /opt/xensource/libexec/InterfaceReconfigureVswitch.py
+cf09a68d9f8b434e79a4c83b01a3bb4b  /etc/xensource/scripts/vif
+EOF
+    then
+        printf "\nVerified host scripts from XenServer 6.0.0.\n"
+    elif md5sum -c --status <<EOF
+2e2c912f86f9c536c89adc34ff3c2b2b  /opt/xensource/libexec/InterfaceReconfigure.py
+28d3ff72d72bdec4f37d70699f5edb76  /opt/xensource/libexec/InterfaceReconfigureBridge.py
+67e1d0af16fc1ddf10009c5c063ad2ba  /opt/xensource/libexec/InterfaceReconfigureVswitch.py
+24bae6906d182ba47668174f8e480cc6  /opt/xensource/libexec/interface-reconfigure
+c5f48246577a17cf1b971fb5ce4e920b  /etc/xensource/scripts/vif
+EOF
+        printf "\nVerified host scripts from XenServer 5.6-FP1.\n"
+    else
+        cat <<EOF
+
+The original XenServer scripts replaced by this package are not those of
+any supported version of XenServer.  This could lead to unexpected
+behavior.  Unless you are sure you know what you are doing, it is highly
+recommended that you remove this package immediately after the install
+completes, which will restore the XenServer scripts that you were
+previously using.
+
+EOF
+    fi    
+fi
+
 if grep -F net.ipv4.conf.all.arp_filter /etc/sysctl.conf >/dev/null 2>&1; then :; else
     cat >>/etc/sysctl.conf <<EOF
 # This works around an issue in xhad, which binds to a particular
-- 
1.7.2.5




More information about the dev mailing list