we got some dhrek we got some doneky we got some fienona
This commit is contained in:
@@ -6,7 +6,6 @@ import "fmt"
|
||||
import "time"
|
||||
import "errors"
|
||||
import "syscall"
|
||||
import "os/user"
|
||||
import "strconv"
|
||||
import "path/filepath"
|
||||
|
||||
@@ -45,24 +44,6 @@ func Spawn (path string, uid, gid uint32, env []string, args ...string) (pid int
|
||||
return process.Pid, process.Release()
|
||||
}
|
||||
|
||||
// LookupUID returns the uid and gid of the given username, if it exists.
|
||||
func LookupUID (name string) (uid, gid uint32, err error) {
|
||||
user, err := user.Lookup(name)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
puid, err := strconv.Atoi(user.Uid)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
pgid, err := strconv.Atoi(user.Gid)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
return uint32(puid), uint32(pgid), nil
|
||||
}
|
||||
|
||||
// PidFile returns the path of a pidfile under the specified name. More
|
||||
// specifically, it returns `/run/<name>.pid`.
|
||||
func PidFile (name string) string {
|
||||
|
||||
Reference in New Issue
Block a user