diff --git a/appvm/qvm-open-in-dvm2 b/appvm/qvm-open-in-dvm2 index 25e8904..2e04aaf 100755 --- a/appvm/qvm-open-in-dvm2 +++ b/appvm/qvm-open-in-dvm2 @@ -25,4 +25,7 @@ if ! [ $# = 1 ] ; then exit 1 fi -exec /usr/lib/qubes/qrexec_client_vm '$dispvm' qubes.OpenInVM "/usr/lib/qubes/qopen-in-vm" "$1" +. /usr/lib/qubes/wrap_in_html_if_url.sh +wrap_in_html_if_url "$1" + +exec /usr/lib/qubes/qrexec_client_vm '$dispvm' qubes.OpenInVM "/usr/lib/qubes/qopen-in-vm" "$FILE_ARGUMENT" diff --git a/appvm/qvm-open-in-vm b/appvm/qvm-open-in-vm index ffd087e..5751270 100755 --- a/appvm/qvm-open-in-vm +++ b/appvm/qvm-open-in-vm @@ -24,5 +24,6 @@ if ! [ $# = 2 ] ; then echo "Usage: $0 vmname filename" exit 1 fi - -exec /usr/lib/qubes/qrexec_client_vm "$1" qubes.OpenInVM "/usr/lib/qubes/qopen-in-vm" "$2" +. /usr/lib/qubes/wrap_in_html_if_url.sh +wrap_in_html_if_url "$2" +exec /usr/lib/qubes/qrexec_client_vm "$1" qubes.OpenInVM "/usr/lib/qubes/qopen-in-vm" "$FILE_ARGUMENT" diff --git a/appvm/wrap_in_html_if_url.sh b/appvm/wrap_in_html_if_url.sh new file mode 100644 index 0000000..12d9225 --- /dev/null +++ b/appvm/wrap_in_html_if_url.sh @@ -0,0 +1,17 @@ +wrap_in_html_if_url() +{ + case "$1" in + *://*) + FILE_ARGUMENT=$(mktemp) + + echo -n '> $FILE_ARGUMENT + echo '">' >> $FILE_ARGUMENT + ;; + *) + FILE_ARGUMENT="$1" + ;; + esac +} + + \ No newline at end of file diff --git a/rpm_spec/core-appvm.spec b/rpm_spec/core-appvm.spec index 229ac11..5b26f83 100644 --- a/rpm_spec/core-appvm.spec +++ b/rpm_spec/core-appvm.spec @@ -79,6 +79,7 @@ cp qvm-open-in-vm $RPM_BUILD_ROOT/usr/bin cp qvm-copy-to-vm $RPM_BUILD_ROOT/usr/bin cp qvm-run $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes +cp wrap_in_html_if_url.sh $RPM_BUILD_ROOT/usr/lib/qubes cp qvm-copy-to-vm2.kde $RPM_BUILD_ROOT/usr/lib/qubes cp qvm-copy-to-vm2.gnome $RPM_BUILD_ROOT/usr/lib/qubes cp ../qrexec/qrexec_agent $RPM_BUILD_ROOT/usr/lib/qubes @@ -159,6 +160,7 @@ rm -rf $RPM_BUILD_ROOT /usr/lib/qubes/qfile-unpacker /usr/lib/qubes/vm-shell /usr/lib/qubes/qrun-in-vm +/usr/lib/qubes/wrap_in_html_if_url.sh %dir /mnt/removable %dir /etc/qubes_rpc /etc/qubes_rpc/qubes.Filecopy