libcontainer/system: remove unused GetParentNSeuid()

This function was added in f103de57ec, but no
longer used since 06f789cf26 (v1.0.0-rc6)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-03-22 14:36:44 +01:00
parent 365c6282c7
commit 249356a1a4
2 changed files with 0 additions and 25 deletions
-17
View File
@@ -3,7 +3,6 @@
package system
import (
"os"
"os/exec"
"sync"
"unsafe"
@@ -117,22 +116,6 @@ func UIDMapInUserNS(uidmap []user.IDMap) bool {
return true
}
// GetParentNSeuid returns the euid within the parent user namespace
func GetParentNSeuid() int64 {
euid := int64(os.Geteuid())
uidmap, err := user.CurrentProcessUIDMap()
if err != nil {
// This kernel-provided file only exists if user namespaces are supported
return euid
}
for _, um := range uidmap {
if um.ID <= euid && euid <= um.ID+um.Count-1 {
return um.ParentID + euid - um.ID
}
}
return euid
}
// SetSubreaper sets the value i as the subreaper setting for the calling process
func SetSubreaper(i int) error {
return unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
-8
View File
@@ -3,8 +3,6 @@
package system
import (
"os"
"github.com/opencontainers/runc/libcontainer/user"
)
@@ -19,9 +17,3 @@ func RunningInUserNS() bool {
func UIDMapInUserNS(uidmap []user.IDMap) bool {
return false
}
// GetParentNSeuid returns the euid within the parent user namespace
// Always returns os.Geteuid on non-linux
func GetParentNSeuid() int {
return os.Geteuid()
}