Documentation ¶
Index ¶
- func GetContainerGroups(groups []string, containerMount string, override *Overrides) ([]uint32, error)
- func GetGroup(containerMount, groupIDorName string) (*user.Group, error)
- func GetUser(containerMount, userIDorName string) (*user.User, error)
- func GetUserGroupInfo(containerMount, containerUser string, override *Overrides) (*user.ExecUser, error)
- type Overrides
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainerGroups ¶
func GetContainerGroups(groups []string, containerMount string, override *Overrides) ([]uint32, error)
GetContainerGroups uses securejoin to get a list of numerical groupids from a container. Per the runc function it calls: If a group name cannot be found, an error will be returned. If a group id cannot be found, or the given group data is nil, the id will be returned as-is provided it is in the legal range.
func GetGroup ¶
GetGroup takes a containermount path and a group name or ID and returns a match Group struct from /etc/group. If it cannot locate a group, an ErrNoGroupEntries error is returned. When the provided group name was an ID, a Group structure with Gid set is returned along with ErrNoGroupEntries.
func GetUser ¶
GetUser takes a containermount path and user name or ID and returns a matching User structure from /etc/passwd. If it cannot locate a user with the provided information, an ErrNoPasswdEntries is returned. When the provided user name was an ID, a User structure with Uid set is returned along with ErrNoPasswdEntries.
func GetUserGroupInfo ¶
func GetUserGroupInfo(containerMount, containerUser string, override *Overrides) (*user.ExecUser, error)
GetUserGroupInfo takes string forms of the container's mount path and the container user and returns a ExecUser with uid, gid, sgids, and home. And override can be provided for defaults.