Skip to content

Commit 076800f

Browse files
fix: set file mode to 0644 after mkstemp in _atomic_write_text
mkstemp() creates files with mode 0600 (owner-only). The original write_text() used the default umask (typically 0644). Restore the expected permissions so other users/processes can read the file.
1 parent 5316b56 commit 076800f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/specify_cli/presets/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def _atomic_write_text(path: Path, content: str) -> None:
6767
fd, tmp = tempfile.mkstemp(
6868
dir=str(path.parent), prefix=f".{path.name}.", suffix=".tmp"
6969
)
70+
os.chmod(tmp, 0o644)
7071
try:
7172
with os.fdopen(fd, "w", encoding="utf-8") as f:
7273
f.write(content)

0 commit comments

Comments
 (0)