From 610902a5c133786f365c78e4aef34d8e303c8b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 31 Oct 2016 14:17:47 +0100 Subject: [PATCH] Revert "qrexec: fix "yes to all" for qrexec calls with custom argument" Do not copy policy file at arbitrary time. This reverts commit 1dff6361b7ca1c7b26d52cd00ca0cedceef2ac00. --- qrexec/qrexec-policy | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/qrexec/qrexec-policy b/qrexec/qrexec-policy index cfb1df9..0d236ae 100755 --- a/qrexec/qrexec-policy +++ b/qrexec/qrexec-policy @@ -9,7 +9,6 @@ import qubes.guihelpers import libvirt from optparse import OptionParser import fcntl -import shutil POLICY_FILE_DIR="/etc/qubes-rpc/policy" # XXX: Backward compatibility, to be removed soon @@ -137,12 +136,7 @@ def confirm_execution(domain, target, service_name): def add_always_allow(domain, target, service_name, options): policy_file=POLICY_FILE_DIR+"/"+service_name if not os.path.isfile(policy_file): - # if we add "always allow" for specifc argument value, base the new - # file on the generic one - policy_file_source = os.path.join(POLICY_FILE_DIR, service_name.split("+")[0]) - if not os.path.isfile(policy_file_source): - return None - shutil.copy2(policy_file_source, policy_file) + return None f = open(policy_file, 'r+') fcntl.flock(f, fcntl.LOCK_EX) lines = []