diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-01-29 14:39:25 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-01-29 14:39:25 +0000 |
commit | fcce277a6e8d56036f6a33bda67aa8dcc03be142 (patch) | |
tree | 0c8244da8d000d8a0029f76618e98a48a5bb976f /pynslcd/group.py | |
parent | 0a8ff1c61c193b17b04adb0c3ced239846be855d (diff) |
split the result handling into a convert() and write() step
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1613 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'pynslcd/group.py')
-rw-r--r-- | pynslcd/group.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pynslcd/group.py b/pynslcd/group.py index 29a6fda..f5bb2b1 100644 --- a/pynslcd/group.py +++ b/pynslcd/group.py @@ -68,7 +68,13 @@ class GroupRequest(common.Request): wantmembers = True - def write(self, dn, attributes, parameters): + def write(self, name, passwd, gid, members): + self.fp.write_string(name) + self.fp.write_string(passwd) + self.fp.write_gid_t(gid) + self.fp.write_stringlist(members) + + def convert(self, dn, attributes, parameters): # get group names and check against requested group name names = attributes['cn'] # get group group password @@ -90,14 +96,11 @@ class GroupRequest(common.Request): # actually return the results for name in names: if not common.isvalidname(name): - logging.warning('%s: %s: denied by validnames option', dn, attmap['cn']) + logging.warning('%s: %s: denied by validnames option', dn, + attmap['cn']) else: for gid in gids: - self.fp.write_int32(constants.NSLCD_RESULT_BEGIN) - self.fp.write_string(name) - self.fp.write_string(passwd) - self.fp.write_gid_t(gid) - self.fp.write_stringlist(members) + yield (name, passwd, gid, members) class GroupByNameRequest(GroupRequest): |