diff --git a/pym/cl_ldap.py b/pym/cl_ldap.py index 65ea3d2..c7e0f23 100644 --- a/pym/cl_ldap.py +++ b/pym/cl_ldap.py @@ -213,16 +213,17 @@ class ldapUser(_error): else: dictOut[dictAttr] = "" elif dictAttr == "groups": - userGroups = [] + userGroupsData = [] for groupDN in groupsDNs: searchGroup = self.ldapObj.ldapSearch(groupDN, ldap.SCOPE_ONELEVEL, "%s=%s" %(ldapAttr,userName), - ["cn"]) + ["cn","gidNumber"]) if searchGroup: - userGroups += map(lambda x: x[0][1]["cn"][0], + userGroupsData += map(lambda x: (x[0][1]["cn"][0], + x[0][1]["gidNumber"][0]), searchGroup) - dictOut[dictAttr] = userGroups + dictOut[dictAttr] = userGroupsData if uid and gid: return dictOut else: