lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1614 - nss-pam-ldapd/pynslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1614 - nss-pam-ldapd/pynslcd



Author: arthur
Date: Sun Jan 29 15:50:27 2012
New Revision: 1614
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1614&view=revision

Log:
small simplification in group lookups (member attributes are not requested 
anyway)

Modified:
   nss-pam-ldapd/pynslcd/group.py

Modified: nss-pam-ldapd/pynslcd/group.py
==============================================================================
--- nss-pam-ldapd/pynslcd/group.py      Sun Jan 29 15:39:25 2012        (r1613)
+++ nss-pam-ldapd/pynslcd/group.py      Sun Jan 29 15:50:27 2012        (r1614)
@@ -66,8 +66,6 @@
 
 class GroupRequest(common.Request):
 
-    wantmembers = True
-
     def write(self, name, passwd, gid, members):
         self.fp.write_string(name)
         self.fp.write_string(passwd)
@@ -83,16 +81,15 @@
         gids = [int(x) for x in attributes['gidNumber']]
         # build member list
         members = set()
-        if self.wantmembers:
-            # add the memberUid values
-            for member in clean(attributes['memberUid']):
-                if common.isvalidname(member):
-                    members.add(member)
-            # translate and add the member values
-            for memberdn in clean(attributes['member']):
-                member = dn2uid(self.conn, memberdn)
-                if member and common.isvalidname(member):
-                    members.add(member)
+        # add the memberUid values
+        for member in clean(attributes['memberUid']):
+            if common.isvalidname(member):
+                members.add(member)
+        # translate and add the member values
+        for memberdn in clean(attributes['member']):
+            member = dn2uid(self.conn, memberdn)
+            if member and common.isvalidname(member):
+                members.add(member)
         # actually return the results
         for name in names:
             if not common.isvalidname(name):
@@ -124,7 +121,6 @@
 class GroupByMemberRequest(GroupRequest):
 
     action = constants.NSLCD_ACTION_GROUP_BYMEMBER
-    wantmembers = False
 
     def read_parameters(self, fp):
         memberuid = fp.read_string()
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/