From 5157d9822e435ef5f183fb1084423a8c4f3b9fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 27 Nov 2015 12:31:33 +0100 Subject: [PATCH] backup: Use 'type' instead of 'which' to prevent unnecessary dependency This fixes using minimal-template based VMs to store/retrieve backup. --- qubes-rpc/qubes.Backup | 2 +- qubes-rpc/qubes.Restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qubes-rpc/qubes.Backup b/qubes-rpc/qubes.Backup index d3ef001..b07478c 100644 --- a/qubes-rpc/qubes.Backup +++ b/qubes-rpc/qubes.Backup @@ -9,7 +9,7 @@ if [ -d "$args" ] ; then else echo "Checking if arguments is matching a command" COMMAND=`echo $args | cut -d ' ' -f 1` - if which "$COMMAND"; then + if type "$COMMAND"; then echo "Redirecting STDIN to $args" # Parsing args to handle quotes correctly # Dangerous method if args are uncontrolled diff --git a/qubes-rpc/qubes.Restore b/qubes-rpc/qubes.Restore index 5db4fa8..2e0a057 100644 --- a/qubes-rpc/qubes.Restore +++ b/qubes-rpc/qubes.Restore @@ -11,7 +11,7 @@ if [ -f "$args" ] ; then else echo "Checking if arguments is matching a command" >&2 COMMAND=`echo $args | cut -d ' ' -f 1` - if which "$COMMAND" >/dev/null; then + if type "$COMMAND" >/dev/null; then tmpdir=`mktemp -d` mkfifo $tmpdir/backup-data echo "Redirecting $args to STDOUT" >&2