Skip to content

Commit f1324a9

Browse files
mrunalpcyphar
authored andcommitted
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>
1 parent c0c8edb commit f1324a9

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

libcontainer/console_linux.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"os"
66
"syscall"
77
"unsafe"
8-
9-
"github.com/opencontainers/runc/libcontainer/label"
108
)
119

1210
// newConsole returns an initialized console that can be used within a container by copying bytes
@@ -63,12 +61,9 @@ func (c *linuxConsole) Close() error {
6361

6462
// mount initializes the console inside the rootfs mounting with the specified mount label
6563
// and applying the correct ownership of the console.
66-
func (c *linuxConsole) mount(mountLabel string) error {
64+
func (c *linuxConsole) mount() error {
6765
oldMask := syscall.Umask(0000)
6866
defer syscall.Umask(oldMask)
69-
if err := label.SetFileLabel(c.slavePath, mountLabel); err != nil {
70-
return err
71-
}
7267
f, err := os.Create("/dev/console")
7368
if err != nil && !os.IsExist(err) {
7469
return err

libcontainer/init_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func setupConsole(pipe *os.File, config *initConfig, mount bool) error {
178178

179179
// Mount the console inside our rootfs.
180180
if mount {
181-
if err := linuxConsole.mount(config.ProcessLabel); err != nil {
181+
if err := linuxConsole.mount(); err != nil {
182182
return err
183183
}
184184
}

0 commit comments

Comments
 (0)