Skip to content

Commit eb3afc4

Browse files
monoidicsebix
authored andcommitted
ENH: utils: acquire groups of intelmq user in drop_privileges
1 parent a9e8d4e commit eb3afc4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

intelmq/lib/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ def drop_privileges() -> bool:
692692
"""
693693
if os.geteuid() == 0:
694694
try:
695+
os.setgroups([group.gr_gid for group in grp.getgrall() if 'intelmq' in group.gr_mem])
695696
os.setgid(grp.getgrnam('intelmq').gr_gid)
696697
os.setuid(pwd.getpwnam('intelmq').pw_uid)
697698
except (OSError, KeyError):

0 commit comments

Comments
 (0)