X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;fp=scripts%2Fcore%2Ffunctions.sh;h=d392c23410c996b9c5d9273e17eb6cb330c6eb70;hb=60f032e75addcfbffaf0399b512bf37c10ebc8c6;hp=44f6155df5417f846af6e6110af554c6c007e271;hpb=72be1908a89acef5eec9f0ebdab4ef6a05204c2b;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 44f6155d..d392c234 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -439,7 +439,10 @@ if [ -z "$skip_all" ]; then # launch sudo with just the variables we want to reach the other side. # we take an extra step to null out the PATH, since MacOS seems to want # to pass that even for a login shell (-i) somehow. - PATH= /usr/bin/sudo --preserve-env=SSH_AUTH_SOCK,IMPORTED_XAUTH "$@" + local varmods="PATH= " + 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 + /usr/bin/sudo $varmods "$@" retval=$? # take the xauth info away again if it wasn't set already.