Commit Graph

8 Commits

Author SHA1 Message Date
Marat Radchenko
d94a789d15 Fix usages of mountinfo.PrefixFilter
It says: The prefix path **must be absolute, have all symlinks resolved, and cleaned**. But those requirements are violated in lots of places.

What happens when it is given a non-canonicalized path is that `mountinfo.GetMounts` will not find mounts.

The trivial case is:
```
$ mkdir a && ln -s a b && mkdir b/c b/d && mount --bind b/c b/d && cat /proc/mounts | grep -- '[ab]/d'
/dev/sdd3 /home/user/a/d ext4 rw,noatime,discard 0 0
```
We asked to bind-mount b/c to b/d, but ended up with mount in a/d.
So, mount table always contains canonicalized mount points, and it is an error to look for non-canonicalized paths in it.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2023-09-10 15:14:26 +03:00
Maksym Pavlenko
3bc8fc4d30 Cleanup build constraints
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 09:36:20 -08:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Maksym Pavlenko
7917da764c Change default directories on Darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-08-04 14:12:32 -07:00
Sebastiaan van Stijn
f6a0ec7c0a
mount.CleanupTempMounts() use github.com/moby/sys/mountinfo
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-08 17:31:55 +01:00
Michael Crosby
0105959c3d Don't prevent boot on temp cleanup
Fixes #2462
Fixes #2455

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-13 16:07:17 -04:00
Kunal Kushwaha
3491b9ea4a Copyright header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-03-05 10:07:58 +09:00
Michael Crosby
b2ec177bb2 Call temp mounts and unmount in containerd server
Fixes #2004

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-02-14 15:16:54 -05:00