diff --git a/libcontainer/console_linux.go b/libcontainer/console_linux.go index 5287b7c6..77588d78 100644 --- a/libcontainer/console_linux.go +++ b/libcontainer/console_linux.go @@ -5,8 +5,6 @@ import ( "os" "syscall" "unsafe" - - "github.com/opencontainers/runc/libcontainer/label" ) // newConsole returns an initialized console that can be used within a container by copying bytes @@ -63,12 +61,9 @@ func (c *linuxConsole) Close() error { // mount initializes the console inside the rootfs mounting with the specified mount label // and applying the correct ownership of the console. -func (c *linuxConsole) mount(mountLabel string) error { +func (c *linuxConsole) mount() error { oldMask := syscall.Umask(0000) defer syscall.Umask(oldMask) - if err := label.SetFileLabel(c.slavePath, mountLabel); err != nil { - return err - } f, err := os.Create("/dev/console") if err != nil && !os.IsExist(err) { return err diff --git a/libcontainer/init_linux.go b/libcontainer/init_linux.go index 5a24cb5f..b6bb227d 100644 --- a/libcontainer/init_linux.go +++ b/libcontainer/init_linux.go @@ -178,7 +178,7 @@ func setupConsole(pipe *os.File, config *initConfig, mount bool) error { // Mount the console inside our rootfs. if mount { - if err := linuxConsole.mount(config.ProcessLabel); err != nil { + if err := linuxConsole.mount(); err != nil { return err } }