Merge pull request #1090 from crosbymichael/bind-root
Remove check for binding to /
This commit is contained in:
commit
7b1bcb3762
|
@ -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.
|
// 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.
|
// dest is required to be an abs path and have any symlinks resolved before calling this function.
|
||||||
func checkMountDestination(rootfs, dest string) error {
|
func checkMountDestination(rootfs, dest string) error {
|
||||||
if libcontainerUtils.CleanPath(rootfs) == libcontainerUtils.CleanPath(dest) {
|
|
||||||
return fmt.Errorf("mounting into / is prohibited")
|
|
||||||
}
|
|
||||||
invalidDestinations := []string{
|
invalidDestinations := []string{
|
||||||
"/proc",
|
"/proc",
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
func TestNeedsSetupDev(t *testing.T) {
|
||||||
config := &configs.Config{
|
config := &configs.Config{
|
||||||
Mounts: []*configs.Mount{
|
Mounts: []*configs.Mount{
|
||||||
|
|
Loading…
Reference in New Issue