Documentation ¶
Index ¶
- Variables
- func Get(passwdPath, groupPath, username string, groups []string) (uint32, uint32, []uint32, error)
- func GetAdditionalGids(groups []string) []uint32
- func GetIntegerID(user string) (uint32, uint32)
- func GetUser(passwdPath, groupPath, user string) (uint32, uint32, error)
- func ParseID(file, str string, parserFilter filterFunc) (uint32, error)
- func ParseString(line string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ( // PasswdFile keeps user passwd information PasswdFile = "/etc/passwd" // GroupFile keeps group information GroupFile = "/etc/group" )
Functions ¶
func Get ¶
Get accepts user and group slice, return valid uid, gid and additional gids. Through Get is a interface returns all user informations runtime-spec need, GetUser, GetIntegerID, GetAdditionalGids still can be used independently.
func GetAdditionalGids ¶
GetAdditionalGids parse supplementary gids from slice groups.
func GetIntegerID ¶
GetIntegerID only parser user format uid:gid, cause container rootfs is not created by contianerd now, can not change user to id, only support user id >= 1000 TODO(huamin.thm): removed later
func GetUser ¶
GetUser accepts user string like <uid|username>:<gid|groupname>, and transfers them to format valid uid:gid. user format example: user uid uid:gid user:group uid:group user:gid
func ParseString ¶
func ParseString(line string, v ...interface{})
ParseString parses line in format a:b:c.
Types ¶
This section is empty.