core-admin/qrexec/qubes_rpc_multiplexer
Marek Marczykowski 2b5ce31eeb dom0+vm/qrexec-services: pass remote domain via env variable not argument
Most qrexec services doesn't use remote domain name, as policy is enforced
earlier. So pass it in way that will allow use of generic command as qrexec
service.
2012-07-14 22:54:23 +02:00

16 lines
336 B
Bash
Executable File

#!/bin/sh
QUBES_RPC=/etc/qubes_rpc
if ! [ $# = 2 ] ; then
echo $0: bad argument count >&2
exit 1
fi
CFG_FILE=$QUBES_RPC/"$1"
export QREXEC_REMOTE_DOMAIN="$2"
if [ -s "$CFG_FILE" ] ; then
exec $(cat "$CFG_FILE")
echo "$0: failed to execute handler for" "$1" >&2
exit 1
fi
echo "$0: nonexistent or empty" "$CFG_FILE" file >&2
exit 1