Skip to content

Commit

Permalink
Workaround for segfault
Browse files Browse the repository at this point in the history
Yes, it segfaults unless that Println is there. Something about that
data.Inheritable smashing the retval on the stack.
  • Loading branch information
swalberg committed Oct 8, 2020
1 parent c69c6b4 commit 2927891
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/capabilities_wrapper/capset_linux.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package main

import (
"fmt"
"os"

"golang.org/x/sys/unix"
)

func capset() error {
fmt.Println("I am a workaround")
header := unix.CapUserHeader{unix.LINUX_CAPABILITY_VERSION_3, int32(os.Getpid())}
data := unix.CapUserData{}
if err := unix.Capget(&header, &data); err != nil {
Expand Down

0 comments on commit 2927891

Please sign in to comment.