fscaps

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package fscaps reads Linux file capabilities.

See capabilities(7) for details.

Index

Constants

View Source
const (
	CHOWN            = 1 << 0  // NOLINT
	DAC_OVERRIDE     = 1 << 1  // NOLINT
	DAC_READ_SEARCH  = 1 << 2  // NOLINT
	FOWNER           = 1 << 3  // NOLINT
	FSETID           = 1 << 4  // NOLINT
	KILL             = 1 << 5  // NOLINT
	SETGID           = 1 << 6  // NOLINT
	SETUID           = 1 << 7  // NOLINT
	SETPCAP          = 1 << 8  // NOLINT
	LINUX_IMMUTABLE  = 1 << 9  // NOLINT
	NET_BIND_SERVICE = 1 << 10 // NOLINT
	NET_BROADCAST    = 1 << 11 // NOLINT
	NET_ADMIN        = 1 << 12 // NOLINT
	NET_RAW          = 1 << 13 // NOLINT
	IPC_LOCK         = 1 << 14 // NOLINT
	IPC_OWNER        = 1 << 15 // NOLINT
	SYS_MODULE       = 1 << 16 // NOLINT
	SYS_RAWIO        = 1 << 17 // NOLINT
	SYS_CHROOT       = 1 << 18 // NOLINT
	SYS_PTRACE       = 1 << 19 // NOLINT
	SYS_PACCT        = 1 << 20 // NOLINT
	SYS_ADMIN        = 1 << 21 // NOLINT
	SYS_BOOT         = 1 << 22 // NOLINT
	SYS_NICE         = 1 << 23 // NOLINT
	SYS_RESOURCE     = 1 << 24 // NOLINT
	SYS_TIME         = 1 << 25 // NOLINT
	SYS_TTY_CONFIG   = 1 << 26 // NOLINT
	MKNOD            = 1 << 27 // NOLINT
	LEASE            = 1 << 28 // NOLINT
	AUDIT_WRITE      = 1 << 29 // NOLINT
	AUDIT_CONTROL    = 1 << 30 // NOLINT
	SETFCAP          = 1 << 31 // NOLINT
	MAC_OVERRIDE     = 1 << 32 // NOLINT
	MAC_ADMIN        = 1 << 33 // NOLINT
	SYSLOG           = 1 << 34 // NOLINT
	WAKE_ALARM       = 1 << 35 // NOLINT
	BLOCK_SUSPEND    = 1 << 36 // NOLINT
	AUDIT_READ       = 1 << 37 // NOLINT
)

These are masks rather than the bare 0, 1, 2, etc. values from the corresponding CAP_* #defines in linux/capability.h to make it easier to construct Caps structs.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caps

type Caps struct {
	// See capabilities(7) for detailed definitions of how these fields are intepreted.
	Effective, Inheritable, Permitted uint64
}

Caps holds capability sets associated with an executable file.

func GetCaps

func GetCaps(path string) (Caps, error)

GetCaps returns Linux capabilities defined for the file at path. No error is returned if the filesystem does not support capabilities.

func (Caps) Empty

func (c Caps) Empty() bool

Empty returns true if no capabilities are present.

func (Caps) String

func (c Caps) String() string

String returns a string representation of capabilities that are present, e.g. "[e:net_raw p:net_raw]".

Jump to

Keyboard shortcuts

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