From e7fd383bce14bd951e799ff9af2b1d5951149fcb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 22 Mar 2021 14:40:52 +0100 Subject: [PATCH] libcontainer/system: un-export UIDMapInUserNS() `UIDMapInUserNS()` is not used anywhere, only internally. so un-export it. Signed-off-by: Sebastiaan van Stijn --- libcontainer/system/linux.go | 4 ++-- libcontainer/system/linux_test.go | 2 +- libcontainer/system/system_fuzzer.go | 2 +- libcontainer/system/unsupported.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libcontainer/system/linux.go b/libcontainer/system/linux.go index f7260256047..eb301073cde 100644 --- a/libcontainer/system/linux.go +++ b/libcontainer/system/linux.go @@ -100,12 +100,12 @@ func RunningInUserNS() bool { // This kernel-provided file only exists if user namespaces are supported return } - inUserNS = UIDMapInUserNS(uidmap) + inUserNS = uidMapInUserNS(uidmap) }) return inUserNS } -func UIDMapInUserNS(uidmap []user.IDMap) bool { +func uidMapInUserNS(uidmap []user.IDMap) bool { /* * We assume we are in the initial user namespace if we have a full * range - 4294967295 uids starting at uid 0. diff --git a/libcontainer/system/linux_test.go b/libcontainer/system/linux_test.go index 4d613d8473d..08e2d6c3b92 100644 --- a/libcontainer/system/linux_test.go +++ b/libcontainer/system/linux_test.go @@ -37,7 +37,7 @@ func TestUIDMapInUserNS(t *testing.T) { if err != nil { t.Fatal(err) } - actual := UIDMapInUserNS(uidmap) + actual := uidMapInUserNS(uidmap) if c.expected != actual { t.Fatalf("expected %v, got %v for %q", c.expected, actual, c.s) } diff --git a/libcontainer/system/system_fuzzer.go b/libcontainer/system/system_fuzzer.go index c1d7630fefa..2354247ebef 100644 --- a/libcontainer/system/system_fuzzer.go +++ b/libcontainer/system/system_fuzzer.go @@ -10,6 +10,6 @@ import ( func FuzzUIDMap(data []byte) int { uidmap, _ := user.ParseIDMap(strings.NewReader(string(data))) - _ = UIDMapInUserNS(uidmap) + _ = uidMapInUserNS(uidmap) return 1 } diff --git a/libcontainer/system/unsupported.go b/libcontainer/system/unsupported.go index 0adf94012b3..829d9dac00e 100644 --- a/libcontainer/system/unsupported.go +++ b/libcontainer/system/unsupported.go @@ -12,8 +12,8 @@ func RunningInUserNS() bool { return false } -// UIDMapInUserNS is a stub for non-Linux systems +// uidMapInUserNS is a stub for non-Linux systems // Always returns false -func UIDMapInUserNS(uidmap []user.IDMap) bool { +func uidMapInUserNS(uidmap []user.IDMap) bool { return false }