release: sync public installer asset remount-fuse.sh
This commit is contained in:
+6
-7
@@ -21,15 +21,14 @@ case "$install_dir" in ''|/|*[![:print:]]*) die 'installation directory is inval
|
||||
[ -d "$install_dir" ] || die "installation directory does not exist: $install_dir"
|
||||
install_dir=$(CDPATH='' cd -- "$install_dir" && pwd -P) || die 'cannot canonicalize installation directory'
|
||||
[ "$(id -u)" -eq 0 ] || die 'FUSE maintenance requires root (euid 0)'
|
||||
INSTALL_PATH="$install_dir" python3 - <<'PY' || die 'installation path components must be root-owned and not group/world writable'
|
||||
INSTALL_PATH="$install_dir" python3 - <<'PY' || die 'installation directory must be root-owned and not group/world writable'
|
||||
import os, pathlib, stat
|
||||
path = pathlib.Path(os.environ['INSTALL_PATH'])
|
||||
current = pathlib.Path(path.root)
|
||||
for part in path.parts[1:]:
|
||||
current /= part
|
||||
info = current.lstat()
|
||||
if info.st_uid != 0 or info.st_mode & 0o022:
|
||||
raise SystemExit(1)
|
||||
info = path.lstat()
|
||||
# Parent directories may belong to the account that owns the home directory.
|
||||
# The installation directory and protected files remain root-owned below.
|
||||
if info.st_uid != 0 or info.st_mode & 0o022:
|
||||
raise SystemExit(1)
|
||||
PY
|
||||
[ -f "$install_dir/.env" ] || die "missing $install_dir/.env"
|
||||
[ -f "$install_dir/compose.yaml" ] || die "missing $install_dir/compose.yaml"
|
||||
|
||||
Reference in New Issue
Block a user