libct/int: don't hardcode CAP_NET_ADMIN

... use the one from unix instead.

Coincidentally, this fixes this warning from gosimple linter:

> libcontainer/integration/exec_test.go:448:2: S1021: should merge variable declaration with assignment on next line (gosimple)
>	var netAdminBit uint
>	^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2020-11-30 10:45:48 -08:00
parent 3387422bf9
commit 3de5c51454
+1 -4
View File
@@ -444,10 +444,7 @@ func TestProcessCaps(t *testing.T) {
t.Fatal("Could not parse effective caps", err)
}
var netAdminMask uint64
var netAdminBit uint
netAdminBit = 12 // from capability.h
netAdminMask = 1 << netAdminBit
const netAdminMask = 1 << unix.CAP_NET_ADMIN
if effectiveCaps&netAdminMask != netAdminMask {
t.Fatal("CAP_NET_ADMIN is not set as expected")
}