From 0d243250f23304fa87815ac819f21dbdc1981f4b Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sun, 4 Dec 2016 16:50:59 +0000 Subject: [PATCH] v2: (vm) qvm-move-to-vm: don't "rm -rf" vm name argument Fixes QubesOS/qubes-issues#2472 from commit 3f600d03fa7069933726ae577da3fcb47845b064 --- Makefile | 3 ++- qubes-rpc/qvm-copy-to-vm | 7 ++++++- qubes-rpc/qvm-move-to-vm | 24 ------------------------ 3 files changed, 8 insertions(+), 26 deletions(-) delete mode 100755 qubes-rpc/qvm-move-to-vm diff --git a/Makefile b/Makefile index 7a3cd5b..68f17fa 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,8 @@ install-common: install -d $(DESTDIR)/usr/bin install -m 0755 misc/qubes-session-autostart $(DESTDIR)/usr/bin/qubes-session-autostart - install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-move-to-vm,qvm-run,qvm-mru-entry} $(DESTDIR)/usr/bin + install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-run,qvm-mru-entry} $(DESTDIR)/usr/bin + ln -s qvm-copy-to-vm $(DESTDIR)/usr/bin/qvm-move-to-vm install qubes-rpc/qvm-copy-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes install qubes-rpc/qvm-move-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes diff --git a/qubes-rpc/qvm-copy-to-vm b/qubes-rpc/qvm-copy-to-vm index 8406d6b..2f8e29f 100755 --- a/qubes-rpc/qvm-copy-to-vm +++ b/qubes-rpc/qvm-copy-to-vm @@ -1,4 +1,5 @@ #!/bin/sh +set -e # # The Qubes OS Project, http://www.qubes-os.org # @@ -25,7 +26,7 @@ if [ $# -lt 2 ] ; then exit 1 fi -if [ x"$1" = "x--without-progress" ] ; then +if [ "$1" = "--without-progress" ] ; then export PROGRESS_TYPE=none shift else @@ -41,3 +42,7 @@ if [ $PROGRESS_TYPE = console ] ; then fi /usr/lib/qubes/qrexec-client-vm $VM qubes.Filecopy /usr/lib/qubes/qfile-agent "$@" + +if [ "${0##*/}" = "qvm-move-to-vm" ]; then + rm -rf -- "$@" +fi diff --git a/qubes-rpc/qvm-move-to-vm b/qubes-rpc/qvm-move-to-vm deleted file mode 100755 index 4c0a52c..0000000 --- a/qubes-rpc/qvm-move-to-vm +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# The Qubes OS Project, http://www.qubes-os.org -# -# Copyright (C) 2010 Rafal Wojtczuk -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# - -. qvm-copy-to-vm "$@" && -rm -rf -- "$@"