Don't pass untrusted arguments to xm info.
authorEvan Broder <broder@mit.edu>
Thu, 5 Feb 2009 08:19:21 +0000 (03:19 -0500)
committerEvan Broder <broder@mit.edu>
Thu, 5 Feb 2009 08:19:21 +0000 (03:19 -0500)
svn path=/trunk/packages/invirt-remote/; revision=2093

debian/changelog
host/usr/sbin/invirt-remote
host/usr/sbin/invirt-vmcontrol

index 31aa76a..fbf50b7 100644 (file)
@@ -1,3 +1,10 @@
+invirt-remote (0.3.2) unstable; urgency=low
+
+  * Don't pass untrusted arguments to xm info.
+  * Exit with a non-0 error code on the host if there's an error.
+
+ -- Evan Broder <broder@mit.edu>  Sat, 31 Jan 2009 03:51:24 -0500
+
 invirt-remote (0.3.1) unstable; urgency=low
 
   * invirt.remote.bcast: provide stderr text when remctl fails
index 8511f60..dcac451 100755 (executable)
@@ -21,7 +21,7 @@ case "$TYPE" in
                 COMMAND=/usr/sbin/invirt-listvms
                ;;
            info)
-               COMMAND=/usr/sbin/xm
+               exec /usr/sbin/xm info
                ;;
             vnccert)
                 COMMAND=/usr/bin/invirt-vnc-getcert
@@ -38,4 +38,4 @@ case "$TYPE" in
         ;;
 esac
 
-$COMMAND "$SERVICE" "$@"
+exec "$COMMAND" "$SERVICE" "$@"
index 70bff12..9080dfc 100755 (executable)
@@ -12,6 +12,10 @@ ORIGMACHINE="$1"
 ACTION="$2"
 MACHINE="d_$ORIGMACHINE"
 
+xm () {
+    command xm "$@" || exit 35
+}
+
 case "$ACTION" in
     list|vcpu-list|uptime)
         xm "$ACTION" "$MACHINE"