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:
parent
d4a76c456d
commit
2518f525de
@ -17,6 +17,9 @@ if [ "$1" != "kernel" ] && [ "$1" != "fuse" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
overlay_mode_sel="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
pwd=$(dirname "$0")
|
pwd=$(dirname "$0")
|
||||||
pwd=$(cd "$pwd" || exit ; /bin/pwd)
|
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_lower}/lower_echo"
|
||||||
cp "$(type -P echo)" "${overlayfs_upper}/upper_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'
|
fuse-overlayfs -o lowerdir="${overlayfs_lower}",upperdir="${overlayfs_upper}",workdir="${overlayfs_workdir}" "${mount_target}"|| fatalerror 'Unable to set up overlayfs'
|
||||||
else
|
else
|
||||||
mount -t overlay -o lowerdir="${overlayfs_lower}",upperdir="${overlayfs_upper}",workdir="${overlayfs_workdir}" none "${mount_target}"|| fatalerror 'Unable to set up overlayfs'
|
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 (upper)" pass exec "${mount_target}/upper_echo" PASS
|
||||||
runchecktest "Exec in overlayfs mount (overlay)" pass exec "${mount_target}/overlay_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}"
|
fusermount -u "${mount_target}" && rmdir "${mount_target}"
|
||||||
else
|
else
|
||||||
umount "${mount_target}" && rmdir "${mount_target}"
|
umount "${mount_target}" && rmdir "${mount_target}"
|
||||||
|
@ -11,4 +11,4 @@
|
|||||||
# Verifies that file rules work in a (fuse) overlayfs
|
# Verifies that file rules work in a (fuse) overlayfs
|
||||||
#=END
|
#=END
|
||||||
|
|
||||||
source "./overlayfs_common.inc" fuse
|
source "./overlayfs_common.inc" fuse "$@"
|
@ -11,4 +11,4 @@
|
|||||||
# Verifies that file rules work in a (kernel) overlayfs
|
# Verifies that file rules work in a (kernel) overlayfs
|
||||||
#=END
|
#=END
|
||||||
|
|
||||||
source "./overlayfs_common.inc" kernel
|
source "./overlayfs_common.inc" kernel "$@"
|
Loading…
x
Reference in New Issue
Block a user