2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 22:05:27 +00:00

Allow empty source and any word only in mount source

This commit is contained in:
Christian Boltz
2025-03-11 21:51:42 +01:00
parent 537fec8b36
commit ae20b62c31

View File

@@ -71,13 +71,13 @@ glob_pattern = (
+ RE_PROFILE_PATH_OR_VAR % 'IGNOREDEV' # path or variable + RE_PROFILE_PATH_OR_VAR % 'IGNOREDEV' # path or variable
+ r'|\{\S*|"\{[^"]*"' # alternation, optionally quoted (note: no leading "/" needed/enforced) + r'|\{\S*|"\{[^"]*"' # alternation, optionally quoted (note: no leading "/" needed/enforced)
+ r'|\*\*\S*|\*\*[^"]*"' # starting with "**" + r'|\*\*\S*|\*\*[^"]*"' # starting with "**"
+ r'|""' # empty source
+ r'|[\w-]+' # any word including "-"
# Note: the closing ')))' needs to be added in the final regex # Note: the closing ')))' needs to be added in the final regex
) )
source_fileglob_pattern = ( source_fileglob_pattern = (
glob_pattern % 'source_file' glob_pattern % 'source_file'
+ r'|""' # empty source
+ r'|[\w-]+' # any word including "-"
+ ')))' + ')))'
) )