Don't label the console as it already has the right label
[@cyphar: removed mountLabel argument from .mount().] Signed-off-by: Mrunal Patel <mrunalp@gmail.com> Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
parent
c0c8edb9e8
commit
f1324a9fc1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue