From 2c9bf3e94369e6576ea576eaa82970a8128a59f5 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 1 Nov 2021 15:17:00 -0700 Subject: :SETUID: pass target uid to POSIX-LOGIN-ENVIRONMENT for correct PATH Signed-off-by: Sean Whitton --- src/util.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util.lisp') diff --git a/src/util.lisp b/src/util.lisp index 1bed222..dc111a2 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -598,10 +598,10 @@ interactive debugger.")) (2 (signal 'skipped-properties) nil) (t ,on-failure)))) -(defun posix-login-environment (logname home) +(defun posix-login-environment (uid logname home) "Reset the environment after switching UID, or similar, in a :LISP connection. Does not currently establish a PAM session." - (let ((rootp (zerop (nix:geteuid))) + (let ((rootp (zerop uid)) (maybe-preserve '("TERM"))) (when rootp (push "SSH_AUTH_SOCK" maybe-preserve)) -- cgit v1.2.3