Versions in this module Expand all Collapse all v0 v0.1.0 Sep 18, 2023 Changes in this version + var ErrNoGroupEntries = errors.New("no matching entries in group file") + var ErrNoPasswdEntries = errors.New("no matching entries in passwd file") + var ErrRange = fmt.Errorf("uids and gids must be in range %d-%d", minID, maxID) + func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, error) + func GetAdditionalGroupsPath(additionalGroups []string, groupPath string) ([]int, error) + func GetGroup() (io.ReadCloser, error) — darwin/amd64, linux/amd64 + func GetGroupPath() (string, error) — darwin/amd64, linux/amd64 + func GetPasswd() (io.ReadCloser, error) — darwin/amd64, linux/amd64 + func GetPasswdPath() (string, error) — darwin/amd64, linux/amd64 + type ExecUser struct + Gid int + Home string + Sgids []int + Uid int + func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (*ExecUser, error) + func GetExecUserPath(userSpec string, defaults *ExecUser, passwdPath, groupPath string) (*ExecUser, error) + type Group struct + Gid int + List []string + Name string + Pass string + func CurrentGroup() (Group, error) + func LookupGid(gid int) (Group, error) + func LookupGroup(groupname string) (Group, error) + func ParseGroup(group io.Reader) ([]Group, error) + func ParseGroupFile(path string) ([]Group, error) + func ParseGroupFileFilter(path string, filter func(Group) bool) ([]Group, error) + func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) + type IDMap struct + Count int64 + ID int64 + ParentID int64 + func CurrentProcessGIDMap() ([]IDMap, error) + func CurrentProcessUIDMap() ([]IDMap, error) + func ParseIDMap(r io.Reader) ([]IDMap, error) + func ParseIDMapFile(path string) ([]IDMap, error) + func ParseIDMapFileFilter(path string, filter func(IDMap) bool) ([]IDMap, error) + func ParseIDMapFilter(r io.Reader, filter func(IDMap) bool) ([]IDMap, error) + type SubID struct + Count int64 + Name string + SubID int64 + func CurrentUserSubGIDs() ([]SubID, error) + func CurrentUserSubUIDs() ([]SubID, error) + func ParseSubID(subid io.Reader) ([]SubID, error) + func ParseSubIDFile(path string) ([]SubID, error) + func ParseSubIDFileFilter(path string, filter func(SubID) bool) ([]SubID, error) + func ParseSubIDFilter(r io.Reader, filter func(SubID) bool) ([]SubID, error) + type User struct + Gecos string + Gid int + Home string + Name string + Pass string + Shell string + Uid int + func CurrentUser() (User, error) + func LookupUid(uid int) (User, error) + func LookupUser(username string) (User, error) + func ParsePasswd(passwd io.Reader) ([]User, error) + func ParsePasswdFile(path string) ([]User, error) + func ParsePasswdFileFilter(path string, filter func(User) bool) ([]User, error) + func ParsePasswdFilter(r io.Reader, filter func(User) bool) ([]User, error)