package cap
import "github.com/containerd/containerd/pkg/cap"
Package cap provides Linux capability utility
Index ¶
- func Current() ([]string, error)
- func FromBitmap(v uint64) ([]string, []int)
- func FromNumber(num int) string
- func Known() []string
- func ParseProcPIDStatus(r io.Reader) (map[Type]uint64, error)
- type Type
Functions ¶
func Current ¶
Current returns the list of the effective and the known caps of the current process.
The result is like []string{"CAP_SYS_ADMIN", ...}.
func FromBitmap ¶
FromBitmap parses an uint64 bitmap into string slice like []{"CAP_SYS_ADMIN", ...}.
Unknown cap numbers are returned as []int.
func FromNumber ¶
FromNumber returns a cap string like "CAP_SYS_ADMIN" that corresponds to the given number like 21.
FromNumber returns an empty string for unknown cap number.
func Known ¶
func Known() []string
Known returns the known cap strings of the latest kernel. The current latest kernel is 5.9.
func ParseProcPIDStatus ¶
ParseProcPIDStatus returns uint64 bitmap value from /proc/<PID>/status file
Types ¶
type Type ¶
type Type int
Type is the type of capability
const ( // Effective is CapEff Effective Type = 1 << iota // Permitted is CapPrm Permitted // Inheritable is CapInh Inheritable // Bounding is CapBnd Bounding // Ambient is CapAmb Ambient )
Source Files ¶
- Version
- v1.7.16
- Published
- Apr 25, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 13 minutes ago –
Tools for package owners.