TODO: get homedir of euid?
This commit is contained in:
parent
6d0cd91683
commit
bb786855fc
@ -24,7 +24,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
// "strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
// "syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
@ -37,6 +39,12 @@ func ExpandHome(path *string) error {
|
|||||||
} else if (*path)[0] != '~' {
|
} else if (*path)[0] != '~' {
|
||||||
return nil
|
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()
|
usr, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user