Skip to content

Commit

Permalink
libcontainer/system: un-export UIDMapInUserNS()
Browse files Browse the repository at this point in the history
`UIDMapInUserNS()` is not used anywhere, only internally. so un-export it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Apr 4, 2021
1 parent 249356a commit e7fd383
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libcontainer/system/linux.go
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/system/linux_test.go
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/system/system_fuzzer.go
Expand Up @@ -10,6 +10,6 @@ import (

func FuzzUIDMap(data []byte) int {
uidmap, _ := user.ParseIDMap(strings.NewReader(string(data)))
_ = UIDMapInUserNS(uidmap)
_ = uidMapInUserNS(uidmap)
return 1
}
4 changes: 2 additions & 2 deletions libcontainer/system/unsupported.go
Expand Up @@ -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
}

0 comments on commit e7fd383

Please sign in to comment.