From 63f3392ff5e0eec009f68e294b188c7af0ca49a1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 19 Feb 2016 16:54:25 +0100 Subject: [PATCH 1/4] Use proper space-expanded tabs, as per the coding guidelines. --- qubes-rpc/qvm-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qubes-rpc/qvm-run b/qubes-rpc/qvm-run index 410ff32..f41104c 100755 --- a/qubes-rpc/qvm-run +++ b/qubes-rpc/qvm-run @@ -21,7 +21,7 @@ # if [ $# -lt 2 ] ; then - cat < Date: Fri, 19 Feb 2016 18:17:40 +0100 Subject: [PATCH 2/4] Move usage information printing to separate function, and print usage to stderr; also added some spacing. --- qubes-rpc/qvm-run | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qubes-rpc/qvm-run b/qubes-rpc/qvm-run index f41104c..0997e61 100755 --- a/qubes-rpc/qvm-run +++ b/qubes-rpc/qvm-run @@ -20,8 +20,8 @@ # # -if [ $# -lt 2 ] ; then - cat <&2 < Date: Fri, 19 Feb 2016 18:19:02 +0100 Subject: [PATCH 3/4] Use proper quoting around variables. --- qubes-rpc/qvm-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qubes-rpc/qvm-run b/qubes-rpc/qvm-run index 0997e61..5bc50e3 100755 --- a/qubes-rpc/qvm-run +++ b/qubes-rpc/qvm-run @@ -40,10 +40,10 @@ if [ $# -lt 2 ] ; then exit 1 fi -VMNAME=$1 +VMNAME="$1" shift -if [ $VMNAME = "--dispvm" ] ; then +if [ "$VMNAME" = "--dispvm" ] ; then VMNAME='$dispvm' fi -exec /usr/lib/qubes/qrexec-client-vm $VMNAME qubes.VMShell "/usr/lib/qubes/qrun-in-vm" "$@" +exec /usr/lib/qubes/qrexec-client-vm "$VMNAME" qubes.VMShell "/usr/lib/qubes/qrun-in-vm" "$@" From bc73cf1fe3cdcbf76c00220249bc013f338a5c93 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 19 Feb 2016 18:19:59 +0100 Subject: [PATCH 4/4] Properly handle case of empty domain name. --- qubes-rpc/qvm-run | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes-rpc/qvm-run b/qubes-rpc/qvm-run index 5bc50e3..f4aa2da 100755 --- a/qubes-rpc/qvm-run +++ b/qubes-rpc/qvm-run @@ -45,5 +45,8 @@ shift if [ "$VMNAME" = "--dispvm" ] ; then VMNAME='$dispvm' +elif [ "$VMNAME" = "" ] ; then + print_usage + exit 1 fi exec /usr/lib/qubes/qrexec-client-vm "$VMNAME" qubes.VMShell "/usr/lib/qubes/qrun-in-vm" "$@"