From fe82c8a4d06fcb3c284310ccc585ea6ad4d5230a Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 29 Sep 2021 16:08:28 -0400 Subject: [PATCH] added OLD_HOME variable pointing to HOME before sudo makes it a bit easier to get back to the "real" user's home dir who started the sudo. --- scripts/core/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 8c9c0b2a..8ad72ccf 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -466,9 +466,9 @@ if [ -z "$skip_all" ]; then # launch sudo with just the variables we want to reach the other side. local varmods= -# varmods+="PATH= " + varmods+="OLD_HOME=$HOME " if [ ! -z "$IMPORTED_XAUTH" ]; then varmods+="IMPORTED_XAUTH=$IMPORTED_XAUTH "; fi - if [ ! -z "$SSH_AUTH_SOCK" ]; then varmods+="SSH_AUTH_SOCK=$SSH_AUTH_SOCK"; fi + if [ ! -z "$SSH_AUTH_SOCK" ]; then varmods+="SSH_AUTH_SOCK=$SSH_AUTH_SOCK "; fi /usr/bin/sudo $varmods "$@" retval=$? -- 2.34.1