def initgroups(uid, primaryGid): """ Initializes the group access list. This uses the stdlib support which calls initgroups(3) under the hood. If the given user is a member of more than C{NGROUPS}, arbitrary groups will be silently discarded to bring the number below that limit. @type uid: C{int} @param uid: The UID for which to look up group information. @type primaryGid: C{int} @param primaryGid: The GID to include when setting the groups. """ return _initgroups(pwd.getpwuid(uid).pw_name, primaryGid)
def initgroups(uid, primaryGid): """ Initializes the group access list. This uses the stdlib support which calls initgroups(3) under the hood. If the given user is a member of more than C{NGROUPS}, arbitrary groups will be silently discarded to bring the number below that limit. @type uid: C{int} @param uid: The UID for which to look up group information. @type primaryGid: C{int} or L{None} @param primaryGid: If provided, an additional GID to include when setting the groups. """ return _initgroups(pwd.getpwuid(uid)[0], primaryGid)