new-dialogue #8

Merged
fedir merged 33 commits from new-dialogue into main 2025-05-06 18:10:44 +02:00
Showing only changes of commit 6065a0c20a - Show all commits

View File

@ -9,6 +9,13 @@ touch ./protected/do-not-remove ./protected/should-be-removed ./protected/truth
chmod 777 ./protected/perm777 ./protected/perm000 chmod 777 ./protected/perm777 ./protected/perm000
echo "Free code, free world." >./protected/motto echo "Free code, free world." >./protected/motto
mkdir protected/haystack
for i in {1..10}; do
touch "./protected/haystack/hay$i"
done
touch ./protected/haystack/needle
echo "Liberty in every line." >./protected/haystack/needle
rm -rf ./openers rm -rf ./openers
mkdir openers mkdir openers
make -C ./opener || ( make -C ./opener || (
@ -151,9 +158,22 @@ openers/symlinked_opener2 ./protected/motto >/dev/null 2>/dev/null &&
echo "[ICFS-TEST]: openers/symlinked_opener2 can read protected/motto despite access being denied!" || echo "[ICFS-TEST]: openers/symlinked_opener2 can read protected/motto despite access being denied!" ||
echo "[ICFS-TEST]: OK" # EACCESS echo "[ICFS-TEST]: OK" # EACCESS
# test permission globbing
icfs_dialogue --set-fake-response yes_perm
icfs_dialogue --set-fake-response-filename "/"
grep 'Liberty' ./protected/haystack/needle >/dev/null &&
echo "[ICFS-TEST]: OK" ||
echo "[ICFS-TEST]: grep cannot read protected/motto despite access being permitted!" # OK
icfs_dialogue --set-fake-response no # this should be ignored
grep "Liberty" ./protected/haystack/* >/dev/null &&
echo "[ICFS-TEST]: OK" ||
echo "[ICFS-TEST]: grep cannot read protected/motto despite access being permitted!" # OK
# test database access # test database access
if [[ -r "./.pt.db" || -w "./.pt.db" ]]; then if [[ -r "./.pt.db" || -w "./.pt.db" ]]; then
echo "[ICFS-TEST]: permanent permissions is accessible!" echo "[ICFS-TEST]: permanent permissions database is accessible!"
else else
echo "[ICFS-TEST]: OK" echo "[ICFS-TEST]: OK"
fi fi