lookup

package
v1.4.2-stable3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func GetGroup(containerMount, groupIDorName string) (*user.Group, error)

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

func GetUser(containerMount, userIDorName string) (*user.User, error)

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 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.

Types

type Overrides

type Overrides struct {
	DefaultUser            *user.ExecUser
	ContainerEtcPasswdPath string
	ContainerEtcGroupPath  string
}

Overrides allows you to override defaults in GetUserGroupInfo

Jump to

Keyboard shortcuts

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