summaryrefslogtreecommitdiff
path: root/lbup/targets.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-15 07:05:54 +0200
committerAnton Khirnov <anton@khirnov.net>2023-10-15 07:08:05 +0200
commit5104d016a178a0ad1938bd15baaa1170fede6a89 (patch)
tree1de1e1bbf9a93e8b73b5aa15084c907f1f9b18fb /lbup/targets.py
parent617ceee6766bd9459b9d938508ed8d52ca9674fd (diff)
_mountinfo: fix mountpoint_for_path()
The correct mount is not the longest one but the last one, because an earlier longer match could be bind-mounted over. This is also shorter and simpler.
Diffstat (limited to 'lbup/targets.py')
-rw-r--r--lbup/targets.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lbup/targets.py b/lbup/targets.py
index bd53b1e..3f86563 100644
--- a/lbup/targets.py
+++ b/lbup/targets.py
@@ -49,6 +49,8 @@ def _resolve_mntdev(mntinfo, dirs):
mountpoint = None
fstype = None
for d in dirs:
+ d = AbsPath(d)
+
mp = mntinfo.mountpoint_for_path(d)
e = list(mntinfo.entries_for_mountpoint(mp))