unshare

package
v0.8.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UsernsEnvName is the environment variable, if set indicates in rootless mode
	UsernsEnvName = "_CONTAINERS_USERNS_CONFIGURED"
)

Variables

This section is empty.

Functions

func GetHostIDMappings

func GetHostIDMappings(pid string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error)

GetHostIDMappings reads mappings for the specified process (or the current process if pid is "self" or an empty string) from the kernel.

func GetRootlessGID

func GetRootlessGID() int

GetRootlessGID returns the GID of the user in the parent userNS

func GetRootlessUID

func GetRootlessUID() int

GetRootlessUID returns the UID of the user in the parent userNS

func GetSubIDMappings

func GetSubIDMappings(user, group string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error)

GetSubIDMappings reads mappings from /etc/subuid and /etc/subgid.

func HasCapSysAdmin

func HasCapSysAdmin() (bool, error)

HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN.

func HomeDir

func HomeDir() (string, error)

HomeDir returns the home directory for the current user.

func IsRootless

func IsRootless() bool

IsRootless tells us if we are running in rootless mode

func ParseIDMappings

func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap, error)

ParseIDMappings parses mapping triples.

Types

type Runnable

type Runnable interface {
	Run() error
}

Jump to

Keyboard shortcuts

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