Do not prevent mounts in /sys

Mounts in /sys like /sys/fs/cgroup are valid and should be allowed at
the libcontainer level.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-05-08 10:47:51 -07:00
parent 3c659cb2ea
commit 02e6427ecf
2 changed files with 2 additions and 3 deletions

View File

@ -215,7 +215,6 @@ func checkMountDestination(rootfs, dest string) error {
}
invalidDestinations := []string{
"/proc",
"/sys",
}
for _, invalid := range invalidDestinations {
path, err := filepath.Rel(filepath.Join(rootfs, invalid), dest)

View File

@ -15,8 +15,8 @@ func TestCheckMountDestOnProc(t *testing.T) {
func TestCheckMountDestInSys(t *testing.T) {
dest := "/rootfs//sys/fs/cgroup"
err := checkMountDestination("/rootfs", dest)
if err == nil {
t.Fatal("destination inside proc should return an error")
if err != nil {
t.Fatal("destination inside /sys should not return an error")
}
}