From 5f22dd0e907e4fa2a6969d282ae0c3671e89b3c0 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 15 Nov 2024 12:05:53 +0100 Subject: [PATCH] sandbox: Only create parent directories if dst does not exist yet --- mkosi/sandbox.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkosi/sandbox.py b/mkosi/sandbox.py index 47ea56493..0cb86378e 100755 --- a/mkosi/sandbox.py +++ b/mkosi/sandbox.py @@ -464,12 +464,12 @@ class BindOperation(FSOperation): if not os.path.exists(src) and not self.required: return - with umask(~0o755): - os.makedirs(os.path.dirname(dst), exist_ok=True) - if not os.path.exists(dst): isfile = os.path.isfile(src) + with umask(~0o755): + os.makedirs(os.path.dirname(dst), exist_ok=True) + with umask(~0o644 if isfile else ~0o755): if isfile: os.close(os.open(dst, os.O_CREAT | os.O_CLOEXEC | os.O_EXCL)) -- 2.47.2