V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m1s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m1s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -894,10 +894,9 @@ pwline="$(getent passwd "${user}" || true)"
|
||||
[[ -n "${pwline}" ]] || { echo "User not found: ${user}" >&2; exit 1; }
|
||||
IFS=: read -r _ _ uid gid _ home _ <<<"${pwline}"
|
||||
|
||||
### 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
|
||||
/bin/bash -s <<'USR'
|
||||
/bin/bash -s <<'ZSHROOT'
|
||||
#!/bin/bash
|
||||
set -Ceuo pipefail
|
||||
export LC_ALL=C
|
||||
@@ -939,12 +938,12 @@ mkdir -p "${ZSH_CUSTOM}/plugins"
|
||||
|
||||
### Do NOT start zsh here and do NOT chsh (RUNZSH/CHSH handled above).
|
||||
:
|
||||
USR
|
||||
ZSHROOT
|
||||
|
||||
### ----------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
else
|
||||
su - "${user}" -s /bin/bash <<'USR'
|
||||
su - "${user}" -s /bin/bash <<'ZSHUSER'
|
||||
#!/bin/bash
|
||||
set -Ceuo pipefail
|
||||
export LC_ALL=C
|
||||
@@ -986,7 +985,7 @@ mkdir -p "${ZSH_CUSTOM}/plugins"
|
||||
|
||||
### Do NOT start zsh here and do NOT chsh (RUNZSH/CHSH handled above).
|
||||
:
|
||||
USR
|
||||
ZSHUSER
|
||||
|
||||
### ----------------------------------------------------------------------------------------------------------------------------
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user