From 3cd0987dca360dfc96d10fdfa495f40b9571ac25 Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Fri, 4 Mar 2016 11:21:34 -0500 Subject: [PATCH] Remove no longer used uid/gid mapping functions Now that all the user namespace code is moved into C, these routines are no longer used. Docker-DCO-1.1-Signed-off-by: Phil Estes (github: estesp) --- libcontainer/container_nouserns_linux.go | 13 ------------ libcontainer/container_userns_linux.go | 26 ------------------------ 2 files changed, 39 deletions(-) delete mode 100644 libcontainer/container_nouserns_linux.go delete mode 100644 libcontainer/container_userns_linux.go diff --git a/libcontainer/container_nouserns_linux.go b/libcontainer/container_nouserns_linux.go deleted file mode 100644 index 3b75d593..00000000 --- a/libcontainer/container_nouserns_linux.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !go1.4 - -package libcontainer - -import ( - "fmt" - "syscall" -) - -// not available before go 1.4 -func (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error { - return fmt.Errorf("User namespace is not supported in golang < 1.4") -} diff --git a/libcontainer/container_userns_linux.go b/libcontainer/container_userns_linux.go deleted file mode 100644 index 5f4cf3c9..00000000 --- a/libcontainer/container_userns_linux.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build go1.4 - -package libcontainer - -import "syscall" - -// Converts IDMap to SysProcIDMap array and adds it to SysProcAttr. -func (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error { - if c.config.UidMappings != nil { - sys.UidMappings = make([]syscall.SysProcIDMap, len(c.config.UidMappings)) - for i, um := range c.config.UidMappings { - sys.UidMappings[i].ContainerID = um.ContainerID - sys.UidMappings[i].HostID = um.HostID - sys.UidMappings[i].Size = um.Size - } - } - if c.config.GidMappings != nil { - sys.GidMappings = make([]syscall.SysProcIDMap, len(c.config.GidMappings)) - for i, gm := range c.config.GidMappings { - sys.GidMappings[i].ContainerID = gm.ContainerID - sys.GidMappings[i].HostID = gm.HostID - sys.GidMappings[i].Size = gm.Size - } - } - return nil -}