2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-03 07:45:50 +00:00

Move the "unsafe" rules of front_perms_ok simple tests to separate test file

This enables us to exercise the front perms parse logic in the utils rule parsing through the simple tests as well

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
Ryan Lee
2025-04-10 11:19:05 -07:00
parent 4e1a8feb03
commit fe9c305ccd
5 changed files with 28 additions and 13 deletions

View File

@@ -15,10 +15,5 @@
file ux /foo3,
file Ux /foo4,
file ix /foo5,
file unsafe px /foo6,
file unsafe Px /foo7,
file unsafe ux /foo8,
file unsafe Ux /foo9,
file unsafe ix /foo10,
}

View File

@@ -0,0 +1,13 @@
#
#=DESCRIPTION perms before pathname with unsafe keyword
#=EXRESULT PASS
#
/usr/bin/foo {
file unsafe px /foo6,
file unsafe Px /foo7,
file unsafe ux /foo8,
file unsafe Ux /foo9,
file unsafe ix /foo10,
}

View File

@@ -14,10 +14,5 @@
ux /foo3,
Ux /foo4,
ix /foo5,
unsafe px /foo6,
unsafe Px /foo7,
unsafe ux /foo8,
unsafe Ux /foo9,
unsafe ix /foo10,
}

View File

@@ -0,0 +1,12 @@
#
#=DESCRIPTION perms before pathname with unsafe keyword
#=EXRESULT PASS
#
/usr/bin/foo {
unsafe px /foo6,
unsafe Px /foo7,
unsafe ux /foo8,
unsafe Ux /foo9,
unsafe ix /foo10,
}

View File

@@ -248,11 +248,11 @@ unknown_line = (
'file/ok_other_3.sd',
# 'unsafe' keyword
'file/file/front_perms_ok_1.sd',
'file/front_perms_ok_1.sd',
'file/file/front_perms_ok_2.sd',
'file/front_perms_ok_2.sd',
'xtrans/simple_ok_cx_1.sd',
# permissions before path and owner / audit {...} blocks
# owner / audit {...} blocks
'file/file/owner/ok_1.sd',
'file/owner/ok_1.sd',
'profile/entry_mods_audit_ok1.sd',