Skip to content

Commit 7b1bcb3

Browse files
author
Mrunal Patel
authored
Merge pull request #1090 from crosbymichael/bind-root
Remove check for binding to /
2 parents 3597b7b + 70b16a5 commit 7b1bcb3

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

libcontainer/rootfs_linux.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,6 @@ func getCgroupMounts(m *configs.Mount) ([]*configs.Mount, error) {
306306
// checkMountDestination checks to ensure that the mount destination is not over the top of /proc.
307307
// dest is required to be an abs path and have any symlinks resolved before calling this function.
308308
func checkMountDestination(rootfs, dest string) error {
309-
if libcontainerUtils.CleanPath(rootfs) == libcontainerUtils.CleanPath(dest) {
310-
return fmt.Errorf("mounting into / is prohibited")
311-
}
312309
invalidDestinations := []string{
313310
"/proc",
314311
}

libcontainer/rootfs_linux_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ func TestCheckMountDestFalsePositive(t *testing.T) {
3232
}
3333
}
3434

35-
func TestCheckMountRoot(t *testing.T) {
36-
dest := "/rootfs"
37-
err := checkMountDestination("/rootfs", dest)
38-
if err == nil {
39-
t.Fatal(err)
40-
}
41-
}
42-
4335
func TestNeedsSetupDev(t *testing.T) {
4436
config := &configs.Config{
4537
Mounts: []*configs.Mount{

0 commit comments

Comments
 (0)