From bb786855fc47812fdd765b378b735043c22289d6 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 19 Feb 2021 03:20:50 -0500 Subject: [PATCH] TODO: get homedir of euid? --- paths/func.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paths/func.go b/paths/func.go index e8e8b61..fce973f 100644 --- a/paths/func.go +++ b/paths/func.go @@ -24,7 +24,9 @@ import ( "os" "os/user" "path/filepath" + // "strconv" "strings" + // "syscall" ) var err error @@ -37,6 +39,12 @@ func ExpandHome(path *string) error { } else if (*path)[0] != '~' { return nil } + // E(ffective)UID (e.g. chown'd user for SUID) + /* + uid := strconv.Itoa(syscall.Geteuid()) + usr, err := user.LookupId(euid) + */ + // R(real)UID (invoking user) usr, err := user.Current() if err != nil { return err