mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 01:57:43 +00:00
Merge Add additional mount regression tests for options= options in combo
Signed-off-by: Ryan Lee <ryan.lee@canonical.com> MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1703 Approved-by: Maxime Bélair <maxime.belair@canonical.com> Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
commit
421558041b
@ -212,6 +212,18 @@ test_nonfs_options_equals_in() {
|
||||
remove_mnt
|
||||
}
|
||||
|
||||
test_nonfs_options_equals_in_ext() {
|
||||
# args: option=$1, option in $2, $3=pass/fail, mount -o $4
|
||||
if [ "$(parser_supports "mount options=($1) options in ($2),")" != "true" ] ; then
|
||||
echo " not supported by parser - skipping mount options=($1) options in ($2),"
|
||||
return
|
||||
fi
|
||||
|
||||
genprofile cap:sys_admin "mount:options=($1) options in ($2)"
|
||||
runchecktest "MOUNT (confined cap mount option=$1 option in $2 ($4))" $3 mount ${loop_device} ${mount_point} -o $4
|
||||
remove_mnt
|
||||
}
|
||||
|
||||
test_dir_options() {
|
||||
if [ "$(parser_supports "mount options=($1),")" != "true" ] ; then
|
||||
echo " not supported by parser - skipping mount option=($1),"
|
||||
@ -288,6 +300,9 @@ test_options() {
|
||||
# TODO: expand this to cover more mount flag combinations
|
||||
test_nonfs_options_equals_in 'nosuid,nodev' 'noatime,noexec'
|
||||
|
||||
test_nonfs_options_equals_in_ext 'nosuid,nodev' 'noatime' 'fail' 'nosuid,nodev,noexec'
|
||||
test_nonfs_options_equals_in_ext 'nosuid,nodev' 'noatime' 'fail' 'nosuid,nodev,noatime,noexec'
|
||||
|
||||
for i in "bind" "rbind" "move"; do
|
||||
test_dir_options $i
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user