From 60a2b58e5735308c1f6f3292271948f8730b9559 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Tue, 23 Jul 2024 06:15:18 -0400 Subject: [PATCH] Revert "Fixed SC2091: Remove surrounding $() to avoid executing output." and fix it another way This reverts commit 67bcaea71e8d59e34787f5fd708ab4f664967e9d. The sub-shell was required to prevent the updated umask from affecting later steps. It broke the permissions of the fetched assets for the control panel: https://discourse.mailinabox.email/t/admin-panel-broken-after-restore-upgrade/12112/24 Instead, the `$()` is replaced with just `()` to create a subshell without executing its output. --- setup/management.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/management.sh b/setup/management.sh index 7fd844ea..fb359cd3 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -54,7 +54,7 @@ hide_output $venv/bin/pip install --upgrade \ # Create a backup directory and a random key for encrypting backups. mkdir -p "$STORAGE_ROOT/backup" if [ ! -f "$STORAGE_ROOT/backup/secret_key.txt" ]; then - umask 077; openssl rand -base64 2048 > "$STORAGE_ROOT/backup/secret_key.txt" + (umask 077; openssl rand -base64 2048 > "$STORAGE_ROOT/backup/secret_key.txt") fi