aboutsummaryrefslogtreecommitdiff
path: root/src/util.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-11-01 15:17:00 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-11-01 15:17:00 -0700
commit2c9bf3e94369e6576ea576eaa82970a8128a59f5 (patch)
treeb13204a1b16c115d3f365fa57a1a842789efe22e /src/util.lisp
parent05164a19652f9b0e7ed70f7030235b048dc4dad7 (diff)
downloadconsfigurator-2c9bf3e94369e6576ea576eaa82970a8128a59f5.tar.gz
:SETUID: pass target uid to POSIX-LOGIN-ENVIRONMENT for correct PATH
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/util.lisp')
-rw-r--r--src/util.lisp4
1 files changed, 2 insertions, 2 deletions
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))