user

package
v0.0.0-...-7ef7dd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PasswdFile keeps user passwd information
	PasswdFile = "/etc/passwd"
	// GroupFile keeps group information
	GroupFile = "/etc/group"
)

Functions

func Get

func Get(passwdPath, groupPath, username string, groups []string) (uint32, uint32, []uint32, error)

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

func GetAdditionalGids(groups []string) []uint32

GetAdditionalGids parse supplementary gids from slice groups.

func GetIntegerID

func GetIntegerID(user string) (uint32, uint32)

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

func GetUser(passwdPath, groupPath, user string) (uint32, uint32, error)

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 ParseID

func ParseID(file, str string, parserFilter filterFunc) (uint32, error)

ParseID parses id or name from given file.

func ParseString

func ParseString(line string, v ...interface{})

ParseString parses line in format a:b:c.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL