Skip to content

Commit eca5f16

Browse files
fix: create parent directories of run output with 0700 (#1)
1 parent aa15e6a commit eca5f16

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/shiftlock/security.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def read_api_key(provider: str) -> SecretStr:
6565

6666

6767
def make_private_directory(path: Path) -> Path:
68-
path.mkdir(mode=0o700, parents=True, exist_ok=True)
68+
missing = [directory for directory in (path, *path.parents) if not directory.exists()]
69+
for directory in reversed(missing):
70+
directory.mkdir(mode=0o700, exist_ok=True)
71+
directory.chmod(0o700)
6972
path.chmod(0o700)
7073
return path
7174

0 commit comments

Comments
 (0)