From e4469c7fde7e65498d47d52cfc813ca52d128ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 27 Sep 2017 02:55:51 +0200 Subject: [PATCH] qrexec: fix domain autostart on qrexec call with 'target=' in policy When policy specify 'target=' option, update 'vm' variable too (used to start appropriate domain), not only 'target' variable (used to make the actual call. Otherwise wrong domain is started (original one, not the one overriden by target= option), and the call fails - since the right domain is not running. --- qrexec/qrexec-policy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qrexec/qrexec-policy b/qrexec/qrexec-policy index afdb481..15921f7 100755 --- a/qrexec/qrexec-policy +++ b/qrexec/qrexec-policy @@ -244,6 +244,13 @@ def main(): if policy_dict["action"] == "allow": if policy_dict.has_key("action.target"): target=policy_dict["action.target"] + vm = validate_target(target) + if vm is None: + print >> sys.stderr, "Rpc failed (unknown domain specified by policy):", domain, target, service_name + text = "Domain '%s' doesn't exist (service %s called by domain %s)." % ( + target, service_name, domain) + info_dialog("error", text) + exit(1) if policy_dict.has_key("action.user"): user=policy_dict["action.user"] else: