2013-03-20 05:24:17 +00:00
|
|
|
#!/bin/sh
|
2014-05-05 03:27:08 +00:00
|
|
|
|
|
|
|
mkfifo /tmp/qrexec-rpc-stderr.$$
|
|
|
|
logger -t "$1-$2" -f /tmp/qrexec-rpc-stderr.$$ &
|
|
|
|
exec 2>/tmp/qrexec-rpc-stderr.$$
|
|
|
|
rm -f /tmp/qrexec-rpc-stderr.$$
|
|
|
|
|
2013-03-20 05:24:17 +00:00
|
|
|
QUBES_RPC=/etc/qubes-rpc
|
|
|
|
# XXX: Backward compatibility
|
|
|
|
DEPRECATED_QUBES_RPC=/etc/qubes_rpc
|
|
|
|
if ! [ $# = 2 ] ; then
|
|
|
|
echo $0: bad argument count >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
export QREXEC_REMOTE_DOMAIN="$2"
|
|
|
|
CFG_FILE=$QUBES_RPC/"$1"
|
|
|
|
if [ -s "$CFG_FILE" ] ; then
|
|
|
|
exec /bin/sh "$CFG_FILE"
|
|
|
|
echo "$0: failed to execute handler for" "$1" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
CFG_FILE=$DEPRECATED_QUBES_RPC/"$1"
|
|
|
|
if [ -s "$CFG_FILE" ] ; then
|
|
|
|
echo "$0: RPC service '$1' uses deprecated directory, please move to $QUBES_RPC" >&2
|
|
|
|
exec /bin/sh "$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
|