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:
Kir Kolyshkin 2020-03-12 18:11:07 -07:00
parent dce0de8975
commit fc4357a8b0
1 changed files with 2 additions and 10 deletions

View File

@ -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.