From f8bba1b2b8b3abcaa9e3733248caef40cb5be70f Mon Sep 17 00:00:00 2001 From: downtownallday Date: Fri, 2 Dec 2022 15:24:21 -0500 Subject: [PATCH] setup: tighten permissions to setup mods backup in user-data --- setup/setupmods.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/setupmods.sh b/setup/setupmods.sh index ca124f0d..48fee34d 100755 --- a/setup/setupmods.sh +++ b/setup/setupmods.sh @@ -31,13 +31,16 @@ backup_mods() { if [ -d "$LOCAL_MODS_DIR" -a ! -z "$(ls -A "$LOCAL_MODS_DIR" 2>/dev/null)" ]; then local tmp="$dst.new" mkdir -p "$(dirname "$dst")" + chmod 750 "$(dirname "$dst")" pushd "$LOCAL_MODS_DIR" >/dev/null + rm -f "$tmp" tar czf "$tmp" \ --exclude-backups \ --exclude-caches \ --exclude=*/__pycache__/* \ --exclude=*/__pycache__ \ * + chmod 640 "$tmp" popd >/dev/null rm -f "$dst" mv "$tmp" "$dst"