|
@@ -21,7 +21,12 @@ func chroot(path string) (err error) {
|
|
return fmt.Errorf("Error creating mount namespace before pivot: %v", err)
|
|
return fmt.Errorf("Error creating mount namespace before pivot: %v", err)
|
|
}
|
|
}
|
|
|
|
|
|
- if err := mount.MakeRPrivate(path); err != nil {
|
|
|
|
|
|
+ // make everything in new ns private
|
|
|
|
+ if err := mount.MakeRPrivate("/"); err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ // ensure path is a mountpoint
|
|
|
|
+ if err := mount.MakePrivate(path); err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|