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