mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 22:35:35 +00:00
add owner parser tests
This commit is contained in:
8
parser/tst/simple_tests/simple_bad_owner_file_1.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_1.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner is not allowed on capability rules
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
owner capability sys_admin,
|
||||
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_2.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_2.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner is not allowed on network rules
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
owner network,
|
||||
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_3.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_3.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner can not follow path name
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
/foo owner rw,
|
||||
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_4.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_4.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner cannot follow permission
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
/foo rw owner,
|
||||
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_5.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_5.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner rules must have comma termination
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
owner /foo rw
|
||||
/bar rw,
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_6.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_6.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner not allowed after forward perm
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
rw owner /foo,
|
||||
|
||||
}
|
8
parser/tst/simple_tests/simple_bad_owner_file_7.sd
Normal file
8
parser/tst/simple_tests/simple_bad_owner_file_7.sd
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#=DESCRIPTION owner not allowed after pathname in forward rule
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
rw /foo owner,
|
||||
|
||||
}
|
9
parser/tst/simple_tests/simple_bad_owner_file_8.sd
Normal file
9
parser/tst/simple_tests/simple_bad_owner_file_8.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION owner block needs } termination
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
/usr/bin/foo {
|
||||
owner {
|
||||
rw foo,
|
||||
|
||||
}
|
25
parser/tst/simple_tests/simple_owner_file.sd
Normal file
25
parser/tst/simple_tests/simple_owner_file.sd
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
#=DESCRIPTION test owner flag for file rules
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
/usr/bin/foo {
|
||||
|
||||
owner /foo rw,
|
||||
owner /foo/** rw,
|
||||
|
||||
owner rw /bar,
|
||||
owner rw /bar/**,
|
||||
|
||||
owner {
|
||||
/one rw,
|
||||
/one/** rw,
|
||||
|
||||
rw /two,
|
||||
rw /two/**,
|
||||
}
|
||||
|
||||
owner {
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user