Skip to content

Instantly share code, notes, and snippets.

@vmarmol
Last active August 29, 2015 14:01
Show Gist options
  • Save vmarmol/7d817660ae436590da86 to your computer and use it in GitHub Desktop.
Save vmarmol/7d817660ae436590da86 to your computer and use it in GitHub Desktop.
gocapability ignored EINVAL
package main
import (
"./capability"
"fmt"
"os"
)
// NOTE: Run as root.
func main() {
c, err := capability.NewPid(os.Getpid())
if err != nil {
fmt.Printf("Error NewPid: %s", err)
}
c.Unset(capability.CAPS|capability.BOUNDS, capability.CAP_SYSLOG)
if err := c.Apply(capability.CAPS | capability.BOUNDS); err != nil {
fmt.Printf("Error setting cap: %s", err)
}
fmt.Printf("Caps: %s\n", c)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment