diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-04-28 20:32:52 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-04-28 20:32:52 +0200 |
commit | ad76395a82a71d1ff872c7c627bf6dada7116ee1 (patch) | |
tree | 0ee5190967449f770e0f5b0e2460ed31ebc5f666 /pynslcd | |
parent | 55c3ad9b7ea2d4ddff70ff2b9c284e3c6a98efa2 (diff) |
remove duplicate and wrong write() method
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1437 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'pynslcd')
-rw-r--r-- | pynslcd/group.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/pynslcd/group.py b/pynslcd/group.py index 4f85441..95ac9b4 100644 --- a/pynslcd/group.py +++ b/pynslcd/group.py @@ -48,39 +48,6 @@ class GroupRequest(common.Request): def write(self, entry): dn, attributes = entry - # get uid attribute and check against requested user name - names = attributes.get('uid', []) - if self.name: - if self.name not in names: - return - names = ( self.name, ) - # get user password entry - passwd = '*' - # get numeric user and group ids - uids = ( self.uid, ) if self.uid else attributes.get(self.attmap_group_uidNumber, []) - uids = [ int(x) for x in uids ] - ( gid, ) = attributes[self.attmap_group_gidNumber] - gid = int(gid) - # FIXME: use expression here - gecos = attributes.get(self.attmap_group_gecos, [None])[0] or attributes.get(self.attmap_group_cn, [''])[0] - ( home, ) = attributes.get(self.attmap_group_homeDirectory, ['']) - ( shell, ) = attributes.get(self.attmap_group_loginShell, ['']) - for name in names: - if not common.isvalidname(name): - print 'Warning: group entry %s contains invalid user name: "%s"' % ( dn, name ) - else: - for uid in uids: - self.fp.write_int32(constants.NSLCD_RESULT_BEGIN) - self.fp.write_string(name) - self.fp.write_string(passwd) - self.fp.write_uid_t(uid) - self.fp.write_gid_t(gid) - self.fp.write_string(gecos) - self.fp.write_string(home) - self.fp.write_string(shell) - - def write(self, entry): - dn, attributes = entry # get group names and check against requested group name names = attributes.get(self.attmap_group_cn, []) if self.name: |