Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pynslcd/shadow.py
diff options
context:
space:
mode:
Diffstat (limited to 'pynslcd/shadow.py')
-rw-r--r--pynslcd/shadow.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/pynslcd/shadow.py b/pynslcd/shadow.py
index 4408c0c..34119b0 100644
--- a/pynslcd/shadow.py
+++ b/pynslcd/shadow.py
@@ -39,16 +39,16 @@ bases = ( 'ou=people,dc=test,dc=tld', )
class ShadowRequest(common.Request):
- def write(self, dn, attributes):
+ def write(self, dn, attributes, parameters):
# get name and check against requested name
names = attributes['uid']
if not names:
print 'Error: entry %s does not contain %s value' % ( dn, attmap['uid'] )
return
- if self.name:
- if self.name not in names:
+ if 'uid' in parameters:
+ if parameters['uid'] not in names:
return
- names = ( self.name, )
+ names = ( parameters['uid'], )
# get password
(passwd, ) = attributes['userPassword']
if not passwd or self.calleruid != 0:
@@ -96,10 +96,9 @@ class ShadowRequest(common.Request):
class ShadowByNameRequest(ShadowRequest):
action = constants.NSLCD_ACTION_SHADOW_BYNAME
- filter_attrs = dict(uid='name')
- def read_parameters(self):
- self.name = self.fp.read_string()
+ def read_parameters(self, fp):
+ return dict(uid=fp.read_string())
class ShadowAllRequest(ShadowRequest):