capability

package
v3.0.0-rc72 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 3 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

Overview

Package capability names the Linux capabilities and parses a capability bounding set as the capability_bounding_set keyword writes it, after the CapabilityBoundingSet of systemd: the capabilities the command keeps, all others dropped, or, the list prefixed with ~, the capabilities it drops.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(n int) string

Name returns the name of the capability of number n, or "cap_<n>" for a number this package does not name, as one of a kernel newer than it.

func Number

func Number(s string) (int, bool)

Number returns the number of the capability named s, in any case, and false when s names none.

Types

type BoundingSet

type BoundingSet struct {
	// Drop says the listed capabilities are the ones dropped, all others
	// kept: the list was prefixed with ~.
	Drop bool

	// Caps are the numbers of the listed capabilities, sorted.
	Caps []int
}

BoundingSet is a capability bounding set: the capabilities it lists, and whether they are the ones kept or the ones dropped.

func ParseBoundingSet

func ParseBoundingSet(s string) (BoundingSet, error)

ParseBoundingSet parses s, a list of capability names separated by spaces, optionally prefixed with ~. A name it does not know is an error, so a typo does not leave the command with a capability its configuration meant to drop. An empty s is the empty set kept: every capability is dropped.

func (BoundingSet) Keeps

func (t BoundingSet) Keeps(n int) bool

Keeps says whether the bounding set keeps the capability of number n.

func (BoundingSet) String

func (t BoundingSet) String() string

String returns the bounding set as ParseBoundingSet parses it back, the names in upper case and in number order.

Jump to

Keyboard shortcuts

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