diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-08-22 15:47:16 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-08-22 15:55:24 -0700 |
commit | 596850bf55899c0217aa53fcff99491fbecdc2b2 (patch) | |
tree | e571da3887b764090c79347884a08f2ff49b0d1d /go/Makefile | |
parent | ac297b51c6730c22a06b759bd4235b47c52053bc (diff) | |
download | libcap2-596850bf55899c0217aa53fcff99491fbecdc2b2.tar.gz |
Add the captree example.
This is a small command line utility for doing something like pstree
but focused on revealing the full capability state of the processes
and threads shown.
This requires support provided in the cap.IABGetPID() function which
will debut in libcap-2.54. For now, the binary is only buildable from
HEAD in the git repository.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go/Makefile')
-rw-r--r-- | go/Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/go/Makefile b/go/Makefile index 6b69cbe..52e1f3e 100644 --- a/go/Makefile +++ b/go/Makefile @@ -15,7 +15,7 @@ PKGDIR=pkg/$(GOOSARCH)/$(IMPORTDIR) DEPS=../libcap/libcap.a ../libcap/libpsx.a -all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns compare-cap try-launching psx-signals +all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns captree compare-cap try-launching psx-signals $(DEPS): make -C ../libcap all @@ -70,6 +70,9 @@ setid: ../goapps/setid/setid.go CAPGOPACKAGE PSXGOPACKAGE gowns: ../goapps/gowns/gowns.go CAPGOPACKAGE CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) build -mod=vendor -o $@ $< +captree: ../goapps/captree/captree.go CAPGOPACKAGE + CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) build -mod=vendor -o $@ $< + ok: ok.go CC="$(CC)" CGO_ENABLED=0 $(GO) build -mod=vendor $< @@ -101,6 +104,7 @@ ifeq ($(CGO_REQUIRED),0) endif ./setid --caps=false ./gowns -- -c "echo gowns runs" + ./captree 0 # Note, the user namespace doesn't require sudo, but I wanted to avoid # requiring that the hosting kernel supports user namespaces for the @@ -127,7 +131,7 @@ install: all clean: rm -f *.o *.so *~ mknames ok good-names.go - rm -f web setid gowns + rm -f web setid gowns captree rm -f compare-cap try-launching try-launching-cgo rm -f $(topdir)/cap/*~ $(topdir)/psx/*~ rm -f b210613 psx-signals psx-signals-cgo |