[ovs-dev] [PATCH 2/2] xenserver: Support network names with spaces
Justin Pettit
jpettit at nicira.com
Tue Mar 2 02:02:18 UTC 2010
The xs-network-names bridge attribute can be set through ovs-vsctl. The
"dump-vif-details" script was not quoting network names, which would
make it appear that parts of a network name with spaces were additional
command arguments. This also fixes a problem in the "vif" script where
even when a network name was properly quoted, it would treat each
element as a separate token when passing it to ovs-vsctl.
Note that this fix is really just a temporary workaround, since the
changes to the "vif" script potentially have security issues. Ben has a
patch in flight which reworks a lot of this code.
Thanks to Ben Pfaff for his yucky-shell-escaping-fu.
---
xenserver/etc_xensource_scripts_vif | 2 +-
.../usr_share_vswitch_scripts_dump-vif-details | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif
index d27bc10..4567f8f 100755
--- a/xenserver/etc_xensource_scripts_vif
+++ b/xenserver/etc_xensource_scripts_vif
@@ -97,7 +97,7 @@ add_to_bridge()
logger -t scripts-vif "Failed to retrieve vif details for vswitch"
fi
- $vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details
+ eval $vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details
;;
esac
diff --git a/xenserver/usr_share_vswitch_scripts_dump-vif-details b/xenserver/usr_share_vswitch_scripts_dump-vif-details
index 430ec54..04ca42c 100755
--- a/xenserver/usr_share_vswitch_scripts_dump-vif-details
+++ b/xenserver/usr_share_vswitch_scripts_dump-vif-details
@@ -60,7 +60,7 @@ def dump_vif_info(domid, devid, vif_ref):
% (bridge, "xs-network-uuids", xs_network_uuid))
xs_network_name = net_rec['name_label']
- print("-- br-set-external-id %s %s %s"
+ print('-- br-set-external-id %s %s "%s"'
% (bridge, "xs-network-names", xs_network_name))
finally:
session.xenapi.session.logout()
--
1.6.5.5
More information about the dev
mailing list