From c5a34a6fe26c0eef126c97bf292dac529e6d0555 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 26 Feb 2016 15:21:33 -0800 Subject: [PATCH] Allow extra mount types This allows the mount syscall to validate the addiontal types where we do not have to perform extra validation and is up to the consumer to verify the functionality of the type of device they are trying to mount. Fixes #572 Signed-off-by: Michael Crosby --- libcontainer/rootfs_linux.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 2892d3ba..e5c0284f 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -146,16 +146,6 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error { } } return nil - case "devpts": - if err := os.MkdirAll(dest, 0755); err != nil { - return err - } - return mountPropagate(m, rootfs, mountLabel) - case "securityfs": - if err := os.MkdirAll(dest, 0755); err != nil { - return err - } - return mountPropagate(m, rootfs, mountLabel) case "bind": stat, err := os.Stat(m.Source) if err != nil { @@ -261,7 +251,10 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error { } } default: - return fmt.Errorf("unknown mount device %q to %q", m.Device, m.Destination) + if err := os.MkdirAll(dest, 0755); err != nil { + return err + } + return mountPropagate(m, rootfs, mountLabel) } return nil }