From 7d82029aec5e657a7d5dc2a2f3a80ba387329bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 8 Jan 2018 02:25:59 +0100 Subject: [PATCH] Fix kdialog --progressbar usage Returned dbus reference is multi-word string, it was not quoted on purpose. ShellCheck was wrong about it. QubesOS/qubes-issues#3449 --- qubes-rpc/qvm-copy-to-vm.kde | 9 ++++++--- qubes-rpc/qvm-move-to-vm.kde | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qubes-rpc/qvm-copy-to-vm.kde b/qubes-rpc/qvm-copy-to-vm.kde index 3e51ae1..181f302 100755 --- a/qubes-rpc/qvm-copy-to-vm.kde +++ b/qubes-rpc/qvm-copy-to-vm.kde @@ -22,7 +22,8 @@ if command -v kdialog 2> /dev/null; then SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1) REF=$(kdialog --progressbar "Copy progress") - qdbus "$REF" org.freedesktop.DBus.Properties.Set "" maximum "$SIZE" + # shellcheck disable=SC2086 + qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum "$SIZE" export PROGRESS_TYPE=gui @@ -31,10 +32,12 @@ if command -v kdialog 2> /dev/null; then /usr/lib/qubes/qfile-agent "$@" | (while read -r sentsize ; do CURRSIZE=$((sentsize / 1024)) - qdbus "$REF" org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE" + # shellcheck disable=SC2086 + qdbus $REF org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE" done) - qdbus "$REF" close + # shellcheck disable=SC2086 + qdbus $REF close # we do not want a dozen error messages, do we # if ! [ "x"$agentstatus = xDONE ] ; then # kdialog --sorry 'Abnormal file copy termination; see /var/log/qubes/qrexec.xid.log in dom0 for more details' diff --git a/qubes-rpc/qvm-move-to-vm.kde b/qubes-rpc/qvm-move-to-vm.kde index da934cb..9ea3493 100755 --- a/qubes-rpc/qvm-move-to-vm.kde +++ b/qubes-rpc/qvm-move-to-vm.kde @@ -25,7 +25,8 @@ if type kdialog 2> /dev/null; then SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1) REF=$(kdialog --progressbar "Move progress") - qdbus "$REF" org.freedesktop.DBus.Properties.Set "" maximum "$SIZE" + # shellcheck disable=SC2086 + qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum "$SIZE" export PROGRESS_TYPE=gui @@ -34,14 +35,16 @@ if type kdialog 2> /dev/null; then /usr/lib/qubes/qfile-agent "$@" | (while read -r sentsize ; do CURRSIZE=$((sentsize / 1024)) - qdbus "$REF" org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE" + # shellcheck disable=SC2086 + qdbus $REF org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE" done) # shellcheck disable=SC2181 if [ $? -eq 0 ]; then rm -rf "$@" fi - qdbus "$REF" close + # shellcheck disable=SC2086 + qdbus $REF close # we do not want a dozen error messages, do we # if ! [ "x"$agentstatus = xDONE ] ; then # kdialog --sorry 'Abnormal file copy termination; see /var/log/qubes/qrexec.xid.log in dom0 for more details'