Skip to content

Commit

Permalink
load secondary groups [RHBZ#1264005]
Browse files Browse the repository at this point in the history
  • Loading branch information
xsuchy committed Jul 15, 2019
1 parent 6bb017f commit c6fe975
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mock/py/mock.py
Expand Up @@ -472,7 +472,9 @@ def setup_uid_manager(mockgid):
# consolehelper
if os.environ.get("USERHELPER_UID") is not None:
unprivUid = int(os.environ['USERHELPER_UID'])
os.setgroups((mockgid,))
unprivName = pwd.getpwuid(unprivUid).pw_name
secondary_groups = [g.gr_gid for g in grp.getgrall() if unprivName in g.gr_mem]
os.setgroups([mockgid] + secondary_groups)
unprivGid = pwd.getpwuid(unprivUid)[3]

uidManager = mockbuild.uid.UidManager(unprivUid, unprivGid)
Expand Down

0 comments on commit c6fe975

Please sign in to comment.