Apply realpath to find mounted points to unmount

Bindings created by some backup methods appears with their 'real' path in /etc/mtab, that may differ from the original /home/yunohost.backup/tmp/auto_xxx that is passed to _recursive_umount().
This fix applies realpath to the 'directory' parameter passed to _recursive_umount().

Tested OK on my own instance, where backups with Borg were failing (except the first one after a reboot) because of this issue (it was unable to clean temporary dir).
This commit is contained in:
tofbouf 2021-05-27 14:28:48 +02:00 committed by GitHub
parent d4b69527e7
commit f0ae164afe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2658,7 +2658,7 @@ def _recursive_umount(directory):
points_to_umount = [
line.split(" ")[2]
for line in mount_lines
if len(line) >= 3 and line.split(" ")[2].startswith(directory)
if len(line) >= 3 and line.split(" ")[2].startswith(os.path.realpath(directory))
]
everything_went_fine = True