From f1324a9fc13e9276c796053ac50b19d10677df74 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Tue, 13 Sep 2016 15:09:09 -0700 Subject: [PATCH] Don't label the console as it already has the right label [@cyphar: removed mountLabel argument from .mount().] Signed-off-by: Mrunal Patel Signed-off-by: Aleksa Sarai --- libcontainer/console_linux.go | 7 +------ libcontainer/init_linux.go | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/libcontainer/console_linux.go b/libcontainer/console_linux.go index 5287b7c6f..77588d78a 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 5a24cb5f0..b6bb227df 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 } }