Skip to content

Commit

Permalink
qrexec: add support for service argument
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Mar 27, 2016
1 parent ad28f4d commit 0607d90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qrexec/qrexec-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ static void handle_execute_service(void)
ENSURE_NULL_TERMINATED(untrusted_params.service_name);
ENSURE_NULL_TERMINATED(untrusted_params.target_domain);
ENSURE_NULL_TERMINATED(untrusted_params.request_id.ident);
sanitize_name(untrusted_params.service_name, "");
sanitize_name(untrusted_params.service_name, "+");
sanitize_name(untrusted_params.target_domain, "");
sanitize_name(untrusted_params.request_id.ident, " ");
params = untrusted_params;
Expand Down
7 changes: 5 additions & 2 deletions qrexec/qrexec-policy
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ def line_to_dict(line):


def read_policy_file(service_name):
policy_file=POLICY_FILE_DIR+"/"+service_name
policy_file = os.path.join(POLICY_FILE_DIR, service_name)
if not os.path.isfile(policy_file):
# fallback to policy without specific argument set (if any)
policy_file = os.path.join(POLICY_FILE_DIR, service_name.split("+")[0])
if not os.path.isfile(policy_file):
policy_file=DEPRECATED_POLICY_FILE_DIR+"/"+service_name
policy_file = os.path.join(DEPRECATED_POLICY_FILE_DIR, service_name)
if not os.path.isfile(policy_file):
return None
print >>sys.stderr, "RPC service '%s' uses deprecated policy location, please move to %s" % (service_name, POLICY_FILE_DIR)
Expand Down

0 comments on commit 0607d90

Please sign in to comment.