2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

regression: pass through args like -r to the overlayfs_common.inc helper

Without this, arguments like -r would not work.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
Ryan Lee 2025-04-29 12:57:56 -07:00
parent d4a76c456d
commit 2518f525de
3 changed files with 7 additions and 4 deletions

View File

@ -17,6 +17,9 @@ if [ "$1" != "kernel" ] && [ "$1" != "fuse" ]; then
exit 1
fi
overlay_mode_sel="$1"
shift
pwd=$(dirname "$0")
pwd=$(cd "$pwd" || exit ; /bin/pwd)
@ -67,7 +70,7 @@ touch "${overlayfs_upper}/upper_file_2"
cp "$(type -P echo)" "${overlayfs_lower}/lower_echo"
cp "$(type -P echo)" "${overlayfs_upper}/upper_echo"
if [ "$1" == "fuse" ]; then
if [ "$overlay_mode_sel" == "fuse" ]; then
fuse-overlayfs -o lowerdir="${overlayfs_lower}",upperdir="${overlayfs_upper}",workdir="${overlayfs_workdir}" "${mount_target}"|| fatalerror 'Unable to set up overlayfs'
else
mount -t overlay -o lowerdir="${overlayfs_lower}",upperdir="${overlayfs_upper}",workdir="${overlayfs_workdir}" none "${mount_target}"|| fatalerror 'Unable to set up overlayfs'
@ -122,7 +125,7 @@ runchecktest "Exec in overlayfs mount (lower)" pass exec "${mount_target}/lower_
runchecktest "Exec in overlayfs mount (upper)" pass exec "${mount_target}/upper_echo" PASS
runchecktest "Exec in overlayfs mount (overlay)" pass exec "${mount_target}/overlay_echo" PASS
if [ "$1" == "fuse" ]; then
if [ "$overlay_mode_sel" == "fuse" ]; then
fusermount -u "${mount_target}" && rmdir "${mount_target}"
else
umount "${mount_target}" && rmdir "${mount_target}"

View File

@ -11,4 +11,4 @@
# Verifies that file rules work in a (fuse) overlayfs
#=END
source "./overlayfs_common.inc" fuse
source "./overlayfs_common.inc" fuse "$@"

View File

@ -11,4 +11,4 @@
# Verifies that file rules work in a (kernel) overlayfs
#=END
source "./overlayfs_common.inc" kernel
source "./overlayfs_common.inc" kernel "$@"