Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 02e6427

Browse files
committed
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 <[email protected]>
1 parent 3c659cb commit 02e6427

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Diff for: rootfs_linux.go

-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ func checkMountDestination(rootfs, dest string) error {
215215
}
216216
invalidDestinations := []string{
217217
"/proc",
218-
"/sys",
219218
}
220219
for _, invalid := range invalidDestinations {
221220
path, err := filepath.Rel(filepath.Join(rootfs, invalid), dest)

Diff for: rootfs_linux_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ func TestCheckMountDestOnProc(t *testing.T) {
1515
func TestCheckMountDestInSys(t *testing.T) {
1616
dest := "/rootfs//sys/fs/cgroup"
1717
err := checkMountDestination("/rootfs", dest)
18-
if err == nil {
19-
t.Fatal("destination inside proc should return an error")
18+
if err != nil {
19+
t.Fatal("destination inside /sys should not return an error")
2020
}
2121
}
2222

0 commit comments

Comments
 (0)