]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add missing sandbox
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 Apr 2024 10:06:15 +0000 (12:06 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 4 Apr 2024 10:42:40 +0000 (12:42 +0200)
mkosi/tree.py

index c774579ab8db24b100bef32a0f9aa4f0f2b08f09..53a8ae550693aeb6607a77e24d687859be865508 100644 (file)
@@ -149,7 +149,10 @@ def rmtree(*paths: Path, tools: Path = Path("/"), sandbox: SandboxProtocol = nos
     if not paths:
         return
 
-    if find_binary("btrfs", root=tools) and (subvolumes := sorted({p for p in paths if is_subvolume(p)})):
+    if (
+        find_binary("btrfs", root=tools) and
+        (subvolumes := sorted({p for p in paths if is_subvolume(p, sandbox=sandbox)}))
+    ):
         # 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(["btrfs", "subvolume", "delete", *subvolumes],