From: Daan De Meyer Date: Wed, 26 Feb 2025 12:35:04 +0000 (+0100) Subject: tree: Ignore symlinks when checking for subvolumes in rmtree() X-Git-Tag: v26~348^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea21ffbb82e819baaaa850734571410608d208b7;p=thirdparty%2Fmkosi.git tree: Ignore symlinks when checking for subvolumes in rmtree() --- diff --git a/mkosi/tree.py b/mkosi/tree.py index 59307605d..93dd40710 100644 --- a/mkosi/tree.py +++ b/mkosi/tree.py @@ -184,7 +184,7 @@ def rmtree(*paths: Path, sandbox: SandboxProtocol = nosandbox) -> None: paths = tuple(p.absolute() for p in paths) - if subvolumes := sorted({p for p in paths if p.exists() and is_subvolume(p)}): + if subvolumes := sorted({p for p in paths if not p.is_symlink() and p.exists() and is_subvolume(p)}): # Silence and ignore failures since when not running as root, this will fail with a permission error # unless the btrfs filesystem is mounted with user_subvol_rm_allowed. run(