mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: add mount path slash filtering equality tests
Test to ensure that slash filtering occurs properly in mount path components. Signed-off-by: Steve Beattie <steve.beattie@canonical.com> MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/607 Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
80d7e33432
commit
51aedb2118
1 changed files with 11 additions and 0 deletions
|
@ -595,6 +595,17 @@ verify_binary_equality "unix rules addr conditional" \
|
|||
"@{HOME}=/a/
|
||||
/t { unix bind addr=@/@{HOME}/bar, }"
|
||||
|
||||
# verify slash filtering for mount rules
|
||||
verify_binary_equality "mount rules slash filtering" \
|
||||
"/t { mount /dev/foo -> /mnt/bar, }" \
|
||||
"/t { mount ///dev/foo -> /mnt/bar, }" \
|
||||
"/t { mount /dev/foo -> /mnt//bar, }" \
|
||||
"/t { mount /dev///foo -> ////mnt/bar, }" \
|
||||
"@{MNT}=/mnt/
|
||||
/t { mount /dev///foo -> @{MNT}/bar, }" \
|
||||
"@{FOO}=/foo
|
||||
/t { mount /dev//@{FOO} -> /mnt/bar, }"
|
||||
|
||||
if [ $fails -ne 0 ] || [ $errors -ne 0 ]
|
||||
then
|
||||
printf "ERRORS: %d\nFAILS: %d\n" $errors $fails 2>&1
|
||||
|
|
Loading…
Add table
Reference in a new issue