V8.00.000.2025.06.17
Some checks failed
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Failing after 32s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-09-16 15:54:09 +02:00
parent 27f42cd00c
commit f5031d18e5

View File

@@ -896,7 +896,11 @@ IFS=: read -r _ _ uid gid _ home _ <<<"${pwline}"
### Prepare a small script that runs as the target user (correct HOME/ownership) ### Prepare a small script that runs as the target user (correct HOME/ownership)
usr_script="$(mktemp /tmp/omz_user_install.XXXXXX)" usr_script="$(mktemp /tmp/omz_user_install.XXXXXX)"
chown "${uid}:${gid}" "${usr_script}"
chmod 0700 "${usr_script}"
cat >|"${usr_script}" <<'USR' cat >|"${usr_script}" <<'USR'
#!/bin/bash
set -Ceuo pipefail set -Ceuo pipefail
export LC_ALL=C export LC_ALL=C
umask 077 umask 077
@@ -942,9 +946,9 @@ USR
### Execute as user (login shell to get proper env), then clean up the temp script. ### Execute as user (login shell to get proper env), then clean up the temp script.
if [[ "${uid}" -eq 0 ]]; then if [[ "${uid}" -eq 0 ]]; then
### root user: no su needed ### root user: no su needed
bash "${usr_script}" /bin/bash "${usr_script}"
else else
su - "${user}" -s /bin/bash -c "bash '${usr_script}'" su - "${user}" -s /bin/bash -c "/bin/bash '${usr_script}'"
fi fi
rm -f -- "${usr_script}" || : rm -f -- "${usr_script}" || :
: :