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
  • Loading branch information
mxsasha committed Apr 25, 2024
1 parent 9be7430 commit 55db11b
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 @@ -95,7 +95,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 55db11b

Please sign in to comment.