mirror of
https://github.com/ben-grande/qusal.git
synced 2024-10-01 02:35:49 -04:00
fix: dom0 qrexec call target qube
This commit is contained in:
parent
a820751ba3
commit
f21f676adf
@ -26,8 +26,8 @@ is_git_repo(){
|
||||
helper="${0##*/git-}"
|
||||
case "${1-}" in
|
||||
-h|--?help) usage;;
|
||||
"") qube="@default";;
|
||||
*) qube="${1}";;
|
||||
"") authority="@default";;
|
||||
*) authority="${1}";;
|
||||
esac
|
||||
case "${2-}" in
|
||||
"") is_git_repo; repo="$(basename "$(git rev-parse --show-toplevel)")";;
|
||||
@ -40,18 +40,12 @@ default_qube="sys-git"
|
||||
rpc_cmd="${vendor}.${rpc}+${repo}"
|
||||
|
||||
if command -v qrexec-client-vm >/dev/null; then
|
||||
exec qrexec-client-vm -- "${qube}" "${rpc_cmd}"
|
||||
exec qrexec-client-vm -- "${authority}" "${rpc_cmd}"
|
||||
elif command -v qrexec-client >/dev/null; then
|
||||
qubes_version="$(awk -F '=' '/^VERSION_ID=/{print $2}' /etc/os-release)"
|
||||
if test "$(echo "${qubes_version}" | tr -d ".")" -le 41; then
|
||||
if test "${qube}" = "@default"; then
|
||||
qube="${default_qube}"
|
||||
fi
|
||||
else
|
||||
policy="$(qrexec-policy --assume-yes-for-ask dom0 "${qube}" "${rpc_cmd}")"
|
||||
qube="$(echo "${policy}" | awk -F '=' '/^target=/{print $2}')"
|
||||
if test "${authority}" = "@default"; then
|
||||
authority="${default_qube}"
|
||||
fi
|
||||
exec qrexec-client -d "${qube}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0"
|
||||
else
|
||||
die "Qrexec programs not found: qrexec-client-vm, qrexec-client"
|
||||
exec qrexec-client -d "${authority}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0"
|
||||
fi
|
||||
|
||||
die "Qrexec programs not found: qrexec-client-vm, qrexec-client"
|
||||
|
@ -69,14 +69,8 @@ if command -v qrexec-client-vm >/dev/null; then
|
||||
log "->" qrexec-client-vm -- "${authority}" "${rpc_cmd}"
|
||||
exec qrexec-client-vm -- "${authority}" "${rpc_cmd}"
|
||||
elif command -v qrexec-client >/dev/null; then
|
||||
qubes_version="$(awk -F '=' '/^VERSION_ID=/{print $2}' /etc/os-release)"
|
||||
if test "$(echo "${qubes_version}" | tr -d ".")" -le 41; then
|
||||
if test "${authority}" = "@default"; then
|
||||
authority="${default_qube}"
|
||||
fi
|
||||
else
|
||||
policy="$(qrexec-policy --assume-yes-for-ask dom0 "${authority}" "${rpc_cmd}")"
|
||||
authority="$(echo "${policy}" | awk -F '=' '/^target=/{print $2}')"
|
||||
if test "${authority}" = "@default"; then
|
||||
authority="${default_qube}"
|
||||
fi
|
||||
log "->" qrexec-client -d "${authority}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0"
|
||||
exec qrexec-client -d "${authority}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0"
|
||||
|
Loading…
Reference in New Issue
Block a user