From ff1d4c11bef187c1cea907edcf0743a6f2008ba6 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sun, 29 Nov 2020 09:24:51 -0800 Subject: [PATCH] don't run profile startup script if user is logged in via su command --- setup/etc/profile.d/03-startup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/etc/profile.d/03-startup.sh b/setup/etc/profile.d/03-startup.sh index fd2104e..29ac0b9 100755 --- a/setup/etc/profile.d/03-startup.sh +++ b/setup/etc/profile.d/03-startup.sh @@ -1,5 +1,6 @@ # this runs startups for bash shell base system - if [ "$SHELL" = "/bin/bash" ] && [ "${BASH_SHELL_STARTUP}" ]; then + # don't run statup if user logs in via su + if [ "$SHELL" = "/bin/bash" ] && [ "${BASH_SHELL_STARTUP}" ] && [ "$(ps -o comm= $PPID)" != "su" ]; then # uncomment for debugging if [[ -f $BASH_SHELL_STARTUP ]] && [[ $EUID -ne 0 ]]; then llog "running startup script $BASH_SHELL_STARTUP async"