Skip to content

Commit

Permalink
Merge pull request #1090 from crosbymichael/bind-root
Browse files Browse the repository at this point in the history
Remove check for binding to /
  • Loading branch information
Mrunal Patel authored Sep 30, 2016
2 parents 3597b7b + 70b16a5 commit 7b1bcb3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
3 changes: 0 additions & 3 deletions libcontainer/rootfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ func getCgroupMounts(m *configs.Mount) ([]*configs.Mount, error) {
// checkMountDestination checks to ensure that the mount destination is not over the top of /proc.
// dest is required to be an abs path and have any symlinks resolved before calling this function.
func checkMountDestination(rootfs, dest string) error {
if libcontainerUtils.CleanPath(rootfs) == libcontainerUtils.CleanPath(dest) {
return fmt.Errorf("mounting into / is prohibited")
}
invalidDestinations := []string{
"/proc",
}
Expand Down
8 changes: 0 additions & 8 deletions libcontainer/rootfs_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ func TestCheckMountDestFalsePositive(t *testing.T) {
}
}

func TestCheckMountRoot(t *testing.T) {
dest := "/rootfs"
err := checkMountDestination("/rootfs", dest)
if err == nil {
t.Fatal(err)
}
}

func TestNeedsSetupDev(t *testing.T) {
config := &configs.Config{
Mounts: []*configs.Mount{
Expand Down

0 comments on commit 7b1bcb3

Please sign in to comment.