mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
simplify mount_condition_pattern
The whole pattern already has `(...)*`, therefore there's no need to make option_pattern optional. Before this change, mount_condition_pattern could have matched - on empty strings (it still can, thanks to the trailing `*` which can also mean "zero matches") or - whitespace-only strings (which is covered by the two regexes using mount_condition_pattern - they both have `\s*` and/or `\s+` around it)
This commit is contained in:
parent
23deb55149
commit
d223751de0
@ -58,7 +58,7 @@ option_pattern = r'\s*(\boption(s?)\b\s*(?P<options_equals_or_in>=|in)\s*'\
|
||||
|
||||
# allow any order of fstype and options
|
||||
# Note: also matches if multiple fstype= or options= are given to keep the regex simpler
|
||||
mount_condition_pattern = rf'({fs_type_pattern}\s*|{option_pattern}?\s*)*'
|
||||
mount_condition_pattern = rf'({fs_type_pattern}\s*|{option_pattern}\s*)*'
|
||||
|
||||
# Source can either be
|
||||
# - A path : /foo
|
||||
|
Loading…
x
Reference in New Issue
Block a user