Permalink
Browse files

fixed SUDO_USER missing in env

  • Loading branch information...
vbox-sk committed Apr 6, 2016
1 parent 78114d2 commit 409a8f7daf8629dcbaf8cca79dc5a23e3e8026ec
Showing with 5 additions and 1 deletion.
  1. +5 −1 sklib/unix.tcl
@@ -32,7 +32,11 @@ proc ::unix::relinquish-root {} {
# When running starpack in background (with &) logname may error with "logname: no login name"
if {[catch {exec logname} user]} {
# Fall back to checking SUDO_USER
set user $::env(SUDO_USER)
if {[info exists ::env(SUDO_USER)]} {
set user $::env(SUDO_USER)
} else {
set user root
}
#puts stderr "relinquish-root: SUDO_USER from env: $user"
# If empty then I don't know, assume root
if {[llength $user] == 0} {

0 comments on commit 409a8f7

Please sign in to comment.