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.
This commit is contained in:
Marek Marczykowski-Górecki 2017-09-27 02:55:51 +02:00
parent 012ca712d2
commit e4469c7fde
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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: