2021-06-10 02:57:03 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
fail() {
|
|
|
|
echo FAILED: $1
|
|
|
|
if [ "$MNT" ]
|
|
|
|
then
|
2021-06-13 22:09:39 +03:00
|
|
|
cd
|
2021-06-10 02:57:03 +03:00
|
|
|
umount "$MNT"
|
|
|
|
rmdir "$MNT"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
MNT=$(mktemp -d)
|
|
|
|
|
|
|
|
ffs --uid $(id -u root) --gid $(id -g root) "$MNT" ../json/object.json &
|
|
|
|
PID=$!
|
2021-06-14 18:38:51 +03:00
|
|
|
sleep 2
|
2021-06-10 02:57:03 +03:00
|
|
|
ls -l "$MNT" | grep root >/dev/null 2>&1 || fail user
|
|
|
|
ls -l "$MNT" | grep $(groups root | cut -d' ' -f 1) >/dev/null 2>&1 || fail group
|
|
|
|
umount "$MNT" || fail unmount
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
kill -0 $PID >/dev/null 2>&1 && fail process
|
|
|
|
|
|
|
|
rmdir "$MNT" || fail mount
|