idmapper

package module
v0.0.0-...-3465c44 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 8

README

IdMapper

GoDoc

idmapper is a package which will map a process to the highest user id available. It was created to be used by GrootFS, a root filesystem manager for CloudFoundry's container runtime.

Unlike the newuidmap and newgidmap commands found in Shadow, idmapper does not require this user to exist and will not check /etc/subuid for valid subuid ranges.

Commands

newuidmap / newgidmap

Will map the given process to the maximum user id available e.g.

$ newuidmap <process id>
$ newgidmap <process id>
maximus

Will return the maximum user id available.

$ maximus
# => 4294967294

idmapper package

This can be used by importing:

"code.cloudfoundry.org/idmapper"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func MustGetMaxValidGID

func MustGetMaxValidGID() int

func MustGetMaxValidUID

func MustGetMaxValidUID() int

Types

type IDMap

type IDMap string
const DefaultGIDMap IDMap = "/proc/self/gid_map"
const DefaultUIDMap IDMap = "/proc/self/uid_map"

func (IDMap) MaxValid

func (u IDMap) MaxValid() (int, error)

type MappingList

type MappingList []specs.LinuxIDMapping

func (MappingList) Map

func (m MappingList) Map(id int) int

func (MappingList) String

func (m MappingList) String() string

type ParseError

type ParseError struct {
	Line string
	Err  error
}

func (ParseError) Error

func (p ParseError) Error() string

Directories

Path Synopsis
cmd
integration

Jump to

Keyboard shortcuts

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