Skip to content

Commit

Permalink
Merge ad3862d into 56d0cd1
Browse files Browse the repository at this point in the history
  • Loading branch information
bhepple committed May 16, 2017
2 parents 56d0cd1 + ad3862d commit e28129e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/diamond
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,14 @@ def main():
try:
if gid != -1 and uid != -1:
# Manually set the groups since they aren't set by default
os.initgroups(pwd.getpwuid(uid).pw_name, gid)

# Python 2.7+
if hasattr(os, 'initgroups'):
os.initgroups(user, gid)
# Python 2.6
else:
os.setgroups([e.gr_gid for e in grp.getgrall()
if user in e.gr_mem] + [gid])

if gid != -1 and os.getgid() != gid:
# Set GID
Expand Down

0 comments on commit e28129e

Please sign in to comment.