Hello, RE_PATH expected (simplified) '/.+', however this excludes a plain '/' that can appear in path rules.
This patch changes the regex so that it also matches '/'.
[ 10-RE_PATH-allow-root.diff ]
=== modified file ./utils/apparmor/regex.py
--- utils/apparmor/regex.py 2016-02-01 21:31:56.427302903 +0100
+++ utils/apparmor/regex.py 2016-01-26 22:22:31.505637218 +0100
@@ -27,7 +27,7 @@
RE_COMMA_EOL = '\s*,' + RE_EOL # optional whitespace, comma + RE_EOL
RE_PROFILE_NAME = '(?P<%s>(\S+|"[^"]+"))' # string without spaces,
or quoted string. %s is the match group name
-RE_PATH = '/\S+|"/[^"]+"' # filename (starting with '/')
without spaces, or quoted filename.
+RE_PATH = '/\S*|"/[^"]*"' # filename (starting with '/')
without spaces, or quoted filename.
RE_PROFILE_PATH = '(?P<%s>(' + RE_PATH + '))' # quoted or unquoted
filename. %s is the match group name
RE_PROFILE_PATH_OR_VAR = '(?P<%s>(' + RE_PATH + '|@{\S+}\S*|"@{\S+}[^"]*"))'
# quoted or unquoted filename or variable. %s is the match group name
Regards,
Christian Boltz
--
>He Mann, isse krasse, erste Wort: "Kyptographie", isse schon falsch.
>Was machst du?
Uuuhhh. Ist in der Listenkasse noch genug Geld für ein Wörterbuch?
[> Ratti und Thorsten Haude in sl-etikette]
signature.asc
Description: This is a digitally signed message part.
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
