Commit a22720d4 authored by Antoine Catton's avatar Antoine Catton

Bugfix on dropPrivileges.

Avoid having two same gid.
parent 714a191f
......@@ -179,7 +179,8 @@ def dropPrivileges(uid, gid):
# drop privileges
user_name = pwd.getpwuid(uid)[0]
group_list = [x.gr_gid for x in grp.getgrall() if user_name in x.gr_mem]
group_list.append(gid)
if gid not in group_list:
group_list.append(gid)
os.initgroups(pwd.getpwuid(uid)[0], gid)
os.setgid(gid)
os.setuid(uid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment