fix(free_games_claimer): keep mode 0600 on the runtime config from creation

The self-copy guard added in 4fd0cd5 dropped "install -m 0600" to a bare
"install" followed by a chmod, which left the credentials in
/config/data/config.env at install's default mode 0755 between the two
commands. Restore the mode on install; the chmod stays for the case
where CONFIG_LOCATION already is the runtime path and install is
skipped.

Verified both branches: different paths and same path each end at mode
600 with exit status 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
alexbelgium
2026-09-24 09:17:22 +02:00
parent 4fd0cd55ec
commit 4f2c5cc8b4

View File

@@ -28,8 +28,9 @@ fi
# The remaster reads /fgc/data/config.env. /fgc/data is linked to /config/data
# by the Dockerfile, so the runtime copy is visible under /addon_configs.
# CONFIG_LOCATION may itself be /config/data/config.env, in which case the two
# paths are the same file and install would fail.
[ "${CONFIG_FILE}" -ef "${RUNTIME_CONFIG}" ] || install "${CONFIG_FILE}" "${RUNTIME_CONFIG}"
# paths are the same file and install would fail. install applies the mode as it
# creates the file; the chmod is for that same-file case.
[ "${CONFIG_FILE}" -ef "${RUNTIME_CONFIG}" ] || install -m 0600 "${CONFIG_FILE}" "${RUNTIME_CONFIG}"
chmod 0600 "${RUNTIME_CONFIG}"
sed -i 's/\r$//' "${RUNTIME_CONFIG}"