From f0ae164afe5fdd6b1fcb6d065090ba1b28cf5b40 Mon Sep 17 00:00:00 2001 From: tofbouf <76905498+tofbouf@users.noreply.github.com> Date: Thu, 27 May 2021 14:28:48 +0200 Subject: [PATCH] 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). --- src/yunohost/backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 3978e835d..99337b2f8 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -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