mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-25 19:03:59 +02:00
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:
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user