Skip to content

Commit

Permalink
Fix #937 - Fix incorrect log access check in setuid startup
Browse files Browse the repository at this point in the history
Introduced in #666

(cherry picked from commit 6213af3)
  • Loading branch information
mxsasha authored and mergify[bot] committed Apr 25, 2024
1 parent 6adce62 commit 5f953e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion irrd/daemon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def main():
if uid and gid:
os.setegid(gid)
os.seteuid(uid)
if staged_logfile_path and not os.access(staged_logfile_path, os.W_OK, effective_ids=True):
staged_logfile_dir = Path(staged_logfile_path).parent
if staged_logfile_path and not os.access(staged_logfile_dir, os.W_OK, effective_ids=True):
logging.critical(
f"Unable to start: logfile {staged_logfile_path} not writable by UID {uid} / GID {gid}"
)
Expand Down

0 comments on commit 5f953e9

Please sign in to comment.