Documentation ¶
Overview ¶
capabilities is a convenience module based on kernel.org/pub/linux/libs/security/libcap for linux capabilities(7) with common functions to set/drop privileges and get/list the current capabilities of a process.
You want to use this early in your main() function.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns lists for the running process of all capabilities set and all inheritable capability vectors: Inh, Amb and Bound as strings.
Example ¶
package main import ( "fmt" "catinello.eu/capabilities" ) func main() { set, iab := capabilities.Get() fmt.Printf("Available capabilities set '%q' and IAB '%q'\n", set, iab) }
Output: Available capabilities set '"="' and IAB '""'
func GetAsOne ¶
func GetAsOne() string
GetAsOne combines the returned results of Get() in one string.
func Set ¶
Set drops all available capabilities except for the given capabilities (cap_from_text(3)) on the running process.
Example ¶
package main import ( "fmt" "log" "catinello.eu/capabilities" ) func main() { if err := capabilities.Set(""); err != nil { log.Fatal(err) } set, iab := capabilities.Get() fmt.Printf("Available capabilities set '%q' and IAB '%q'\n", set, iab) }
Output: Available capabilities set '"="' and IAB '""'
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.