From f549791461162797e96324da111b7a7665cb20bc Mon Sep 17 00:00:00 2001 From: Yoshio Date: Tue, 13 Oct 2026 21:36:34 +0700 Subject: [PATCH] fix: create parent directories of run output with 0700 --- src/shiftlock/security.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shiftlock/security.py b/src/shiftlock/security.py index 18bea53..af77bc8 100644 --- a/src/shiftlock/security.py +++ b/src/shiftlock/security.py @@ -65,7 +65,10 @@ def read_api_key(provider: str) -> SecretStr: def make_private_directory(path: Path) -> Path: - path.mkdir(mode=0o700, parents=True, exist_ok=True) + missing = [directory for directory in (path, *path.parents) if not directory.exists()] + for directory in reversed(missing): + directory.mkdir(mode=0o700, exist_ok=True) + directory.chmod(0o700) path.chmod(0o700) return path