qubes-rpc: fix broken temporary file deletion in qubes.GetImageRGBA

This commit is contained in:
qubesuser 2015-09-06 11:07:57 +02:00
parent e924758c54
commit 20dd5d2d1a

View File

@ -21,10 +21,10 @@ elif [ "${filename}" = "-" ] || [ "${filename##*:}" = "-" ]; then
tmpfile="$(mktemp /tmp/qimg-XXXXXXXX)"
cat > "${tmpfile}"
if [ "${filename##*:}" = "-" ]; then
tmpfile="${filename%:*}:${tmpfile}"
filename="${filename%:*}:${tmpfile}"
else
filename="${tmpfile}"
fi
filename="${tmpfile}"
elif ! [ -r "${filename}" ]; then
exit 1
fi
@ -34,6 +34,6 @@ fi
identify -format '%w %h\n' "$filename" | sed -e '/^$/d'
convert -depth 8 "$filename" rgba:-
[ -n "${tmpfile}" ] && rm -f ${tmpfile} || true
[ -n "${tmpfile}" ] && rm -f "${tmpfile}" || true
# vim: ft=sh ts=4 sw=4 et