From ad76395a82a71d1ff872c7c627bf6dada7116ee1 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 28 Apr 2011 18:32:52 +0000 Subject: 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 --- pynslcd/group.py | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'pynslcd') diff --git a/pynslcd/group.py b/pynslcd/group.py index 4f85441..95ac9b4 100644 --- a/pynslcd/group.py +++ b/pynslcd/group.py @@ -46,39 +46,6 @@ class GroupRequest(common.Request): wantmembers = True - 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 -- cgit v1.2.3