From 905ca72a8fc174be0d012c2c87fa6f0437bc9790 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 23 Feb 2018 16:54:40 +0100 Subject: [PATCH] rule-syntax-check: PROGRAM is not supposed to get value assigned In udev man page, "PROGRAM" key is part of the keys which are used for matching purposes so it should only be used with the compare operator "==". Actually it doesn't really make sense to assign it a value. udev code allows both "=" and "==" for PROGRAM and both are handled the same way but for consistencies it's better to have only the compare operator allowed by the rule syntax checker. No rules shipped by systemd use PROGRAM key so nothing need to be changed in our rule files. --- test/rule-syntax-check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rule-syntax-check.py b/test/rule-syntax-check.py index e053b027ca..f24285ddac 100755 --- a/test/rule-syntax-check.py +++ b/test/rule-syntax-check.py @@ -28,9 +28,9 @@ rules_files = sys.argv[1:] if not rules_files: sys.exit('Specify files to test as arguments') -no_args_tests = re.compile(r'(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$') +no_args_tests = re.compile(r'(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|PROGRAM|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$') args_tests = re.compile(r'(ATTRS?|ENV|TEST){([a-zA-Z0-9/_.*%-]+)}\s*(?:=|!)=\s*"([^"]*)"$') -no_args_assign = re.compile(r'(NAME|SYMLINK|OWNER|GROUP|MODE|TAG|PROGRAM|RUN|LABEL|GOTO|OPTIONS|IMPORT)\s*(?:\+=|:=|=)\s*"([^"]*)"$') +no_args_assign = re.compile(r'(NAME|SYMLINK|OWNER|GROUP|MODE|TAG|RUN|LABEL|GOTO|OPTIONS|IMPORT)\s*(?:\+=|:=|=)\s*"([^"]*)"$') args_assign = re.compile(r'(ATTR|ENV|IMPORT|RUN){([a-zA-Z0-9/_.*%-]+)}\s*(=|\+=)\s*"([^"]*)"$') result = 0 -- 2.25.1