libct/msMoveRoot: rm redundant filepath.Abs() calls
1. rootfs is already validated to be kosher by (*ConfigValidator).rootfs() 2. mount points from /proc/self/mountinfo are absolute and clean, too Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
dce0de8975
commit
fc4357a8b0
|
@ -810,18 +810,10 @@ func msMoveRoot(rootfs string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
absRootfs, err := filepath.Abs(rootfs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, info := range mountinfos {
|
||||
p, err := filepath.Abs(info.Mountpoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p := info.Mountpoint
|
||||
// Umount every syfs and proc file systems, except those under the container rootfs
|
||||
if (info.Fstype != "proc" && info.Fstype != "sysfs") || filepath.HasPrefix(p, absRootfs) {
|
||||
if (info.Fstype != "proc" && info.Fstype != "sysfs") || filepath.HasPrefix(p, rootfs) {
|
||||
continue
|
||||
}
|
||||
// Be sure umount events are not propagated to the host.
|
||||
|
|
Loading…
Reference in New Issue