Skip to content

Commit cd126ee

Browse files
fix: set file mode to 0644 after mkstemp in _safe_write_json
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 4485bd9 commit cd126ee

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/specify_cli/events.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,7 @@ def _safe_write_json(dst: Path, data: dict) -> None:
20172017
fd, tmp = tempfile.mkstemp(
20182018
dir=str(dst.parent), prefix=f".{dst.name}.", suffix=".tmp"
20192019
)
2020+
os.chmod(tmp, 0o644)
20202021
try:
20212022
with os.fdopen(fd, "w", encoding="utf-8") as f:
20222023
json.dump(data, f, indent=2)

0 commit comments

Comments
 (0)