]> xenbits.xensource.com Git - libvirt.git/commitdiff
libvirt-guests: avoid globbing when splitting $URIS
authorEric Blake <eblake@redhat.com>
Fri, 11 Mar 2011 21:06:09 +0000 (14:06 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 14 Mar 2011 21:00:36 +0000 (15:00 -0600)
* tools/libvirt-guests.init.sh (start, stop, gueststatus): Avoid
shell globbing, since valid URIs can contain '?'.

tools/libvirt-guests.init.sh

index 0b64cf6cd4a24a5595df92cd7a9c9d9915153e3c..f247e5e449400883b09ab53a073f43f690e67577 100644 (file)
@@ -143,12 +143,15 @@ start() {
 
     while read uri list; do
         configured=false
+        set -f
         for confuri in $URIS; do
+            set +f
             if [ "x$confuri" = "x$uri" ]; then
                 configured=true
                 break
             fi
         done
+        set +f
         if ! "$configured"; then
             eval_gettext "Ignoring guests on \$uri URI"; echo
             continue
@@ -241,7 +244,9 @@ stop() {
     fi
 
     : >"$LISTFILE"
+    set -f
     for uri in $URIS; do
+        set +f
         eval_gettext "Running guests on \$uri URI: "
 
         if [ "x$uri" = xdefault ] && [ ! -x "$libvirtd" ]; then
@@ -265,6 +270,7 @@ stop() {
             fi
         fi
     done
+    set +f
 
     while read uri list; do
         if "$suspending"; then
@@ -286,10 +292,13 @@ stop() {
 }
 
 gueststatus() {
+    set -f
     for uri in $URIS; do
+        set +f
         echo "* $uri URI:"
         retval run_virsh "$uri" list || echo
     done
+    set +f
 }
 
 # rh_status