glacier-ng 4.0.0
This commit is contained in:
commit
0cf4829fa5
159 files changed
+33717
No files matched your search
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
# Per-user layout + doas self-service tests: /glacier/usr/<uid> ownership,
|
||||
# `doas gstore -n` for yourself only, root `gstore -n UID`, refusal of
|
||||
# squatted / loosened / symlinked bases, and syspkg alongside. Runs INSIDE
|
||||
# the Dockerfile.alpine_root image (needs its glacier user + doas rule):
|
||||
#
|
||||
# ./run_docker.sh Dockerfile.alpine_root # builds glacier-alpine_root
|
||||
# docker run --rm -v "$PWD/tests/user_layout_alpine.sh:/t.sh:ro" glacier-alpine_root sh /t.sh
|
||||
cd /app
|
||||
U() { su glacier -c "cd /app && $1" 2>&1 | sed 's/\x1b\[[0-9;]*m//g'; }
|
||||
R() { sh -c "$1" 2>&1 | sed 's/\x1b\[[0-9;]*m//g'; }
|
||||
hr() { echo; echo "=== $*"; }
|
||||
|
||||
hr "1. user before setup: gpkg points at doas gstore -n"
|
||||
U "echo y | ./gpkg -l kilo-0.0.1.gpkg"
|
||||
hr "2. user without doas: refused with hint"
|
||||
U "./gstore -n"
|
||||
hr "3. user via doas: creates OWN dir (uid derived)"
|
||||
U "doas /app/gstore -n"
|
||||
ls -la /glacier /glacier/usr /glacier/usr/1000
|
||||
hr "4. user via doas naming another uid: doas refuses"
|
||||
U "doas /app/gstore -n 1001"
|
||||
hr "5. user via doas again: already exists"
|
||||
U "doas /app/gstore -n"
|
||||
hr "6. user installs + removes (no root involved)"
|
||||
U "echo y | ./gpkg -l kilo-0.0.1.gpkg"
|
||||
ls -la /glacier/usr/1000/links/bin/
|
||||
U ". /etc/profile.d/glacier.sh; command -v kilo"
|
||||
U "echo y | ./gpkg -x kilo" | tail -2
|
||||
ls -A /glacier/usr/1000
|
||||
hr "7. root creates for another uid; that user can then install"
|
||||
adduser -D -u 1001 alice >/dev/null
|
||||
R "/app/gstore -n 1001"
|
||||
su alice -c "cd /app && echo y | ./gpkg -l kilo-0.0.1.gpkg" 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tail -1
|
||||
hr "8. users can't see into each other's dirs"
|
||||
U "ls /glacier/usr/1001"
|
||||
hr "9. squatted base (wrong owner) is refused"
|
||||
chown -R 1000 /glacier/usr/1001
|
||||
su alice -c "cd /app && echo y | ./gpkg -l kilo-0.0.1.gpkg" 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tail -1
|
||||
hr "10. root cleans it up and re-creates"
|
||||
R "/app/gstore -x 1001 && /app/gstore -n 1001" | tail -2
|
||||
hr "11. loosened /glacier/usr is refused by gpkg and gstore"
|
||||
chmod 777 /glacier/usr
|
||||
U "echo y | ./gpkg -l kilo-0.0.1.gpkg" | tail -1
|
||||
adduser -D -u 1002 bob >/dev/null
|
||||
R "/app/gstore -n 1002"
|
||||
chmod 755 /glacier/usr
|
||||
hr "12. symlink in place of a base: delete refuses to follow it"
|
||||
mkdir -p /tmp/victim && touch /tmp/victim/keep && ln -s /tmp/victim /glacier/usr/1003
|
||||
R "/app/gstore -x 1003"; ls /tmp/victim
|
||||
rm /glacier/usr/1003
|
||||
hr "13. syspkg still works; lock now in /glacier/sys"
|
||||
R "./syspkg -n && echo y | ./syspkg -l kilo-0.0.1.gpkg" | tail -1
|
||||
ls -A /glacier/sys; ls -A /glacier/usr
|
||||
hr "14. help"
|
||||
R "./gstore -h" | sed -n 2p
|
||||
R "./gstore -h" | grep -- "--new"
|
||||
Reference in new issue
Block a user