Skip to content

Commit

Permalink
ENH: utils: acquire groups of intelmq user in drop_privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
monoidic committed Jul 3, 2024
1 parent dba94eb commit 569bf1e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions intelmq/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ def drop_privileges() -> bool:
"""
if os.geteuid() == 0:
try:
os.setgroups([group.gr_gid for group in grp.getgrall() if 'intelmq' in group.gr_mem])
os.setgid(grp.getgrnam('intelmq').gr_gid)
os.setuid(pwd.getpwnam('intelmq').pw_uid)
except (OSError, KeyError):
Expand Down

0 comments on commit 569bf1e

Please sign in to comment.