mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
add keyword 'other' vim syntax support, plus language parsing tests
Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
9bb81e1ed3
commit
cb679f3206
7
parser/tst/simple_tests/file/allow/ok_other_1.sd
Normal file
7
parser/tst/simple_tests/file/allow/ok_other_1.sd
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION simple allow other flag test
|
||||
#=EXRESULT PASS
|
||||
|
||||
profile test {
|
||||
allow other /tmp/** rw,
|
||||
}
|
7
parser/tst/simple_tests/file/allow/ok_other_2.sd
Normal file
7
parser/tst/simple_tests/file/allow/ok_other_2.sd
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION simple audit allow other flag test
|
||||
#=EXRESULT PASS
|
||||
|
||||
profile test {
|
||||
audit allow other /tmp/** rw,
|
||||
}
|
7
parser/tst/simple_tests/file/ok_other_2.sd
Normal file
7
parser/tst/simple_tests/file/ok_other_2.sd
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION simple deny other flag test
|
||||
#=EXRESULT PASS
|
||||
|
||||
profile test {
|
||||
deny other /tmp/** rw,
|
||||
}
|
7
parser/tst/simple_tests/file/ok_other_3.sd
Normal file
7
parser/tst/simple_tests/file/ok_other_3.sd
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
#=DESCRIPTION simple other flag test
|
||||
#=EXRESULT PASS
|
||||
|
||||
profile test {
|
||||
audit other /tmp/** rw,
|
||||
}
|
@ -89,11 +89,11 @@ filename = r'(\/|\@\{\S*\})\S*'
|
||||
|
||||
aa_regex_map = {
|
||||
'FILENAME': filename,
|
||||
'FILE': r'\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+)?' + filename + r'\s+', # Start of a file rule
|
||||
'FILE': r'\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?' + filename + r'\s+', # Start of a file rule
|
||||
# (whitespace_+_, owner etc. flag_?_, filename pattern, whitespace_+_)
|
||||
'DENYFILE': r'\v^\s*(audit\s+)?deny\s+(owner\s+)?' + filename + r'\s+', # deny, otherwise like FILE
|
||||
'auditdenyowner': r'(audit\s+)?(deny\s+|allow\s+)?(owner\s+)?',
|
||||
'audit_DENY_owner': r'(audit\s+)?deny\s+(owner\s+)?', # must include "deny", otherwise like auditdenyowner
|
||||
'DENYFILE': r'\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?' + filename + r'\s+', # deny, otherwise like FILE
|
||||
'auditdenyowner': r'(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?',
|
||||
'audit_DENY_owner': r'(audit\s+)?deny\s+(owner\s+|other\s+)?', # must include "deny", otherwise like auditdenyowner
|
||||
'auditdeny': r'(audit\s+)?(deny\s+|allow\s+)?',
|
||||
'EOL': r'\s*,(\s*$|(\s*#.*$)\@=)', # End of a line (whitespace_?_, comma, whitespace_?_ comment.*)
|
||||
'TRANSITION': r'(\s+-\>\s+\S+)?',
|
||||
|
Loading…
x
Reference in New Issue
Block a user