Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pynslcd/shadow.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-08-21 21:52:41 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-08-21 21:52:41 +0200
commit7b474d0d1cf1a5c7a7b59e55b29a9778d5925742 (patch)
treeb6f7cf72f20b3a5dbb4a4fc21962f0f1e6ddde5f /pynslcd/shadow.py
parentb0358f74944cd5d7e984700d61da989b5f98cb18 (diff)
Have pynslcd handle mapped userPassword
This fixes an error that could occur when the userPassword was retrieved from LDAP and insufficient privileges were available for reading the attribute.
Diffstat (limited to 'pynslcd/shadow.py')
-rw-r--r--pynslcd/shadow.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pynslcd/shadow.py b/pynslcd/shadow.py
index 5fd0aa9..89dbbfa 100644
--- a/pynslcd/shadow.py
+++ b/pynslcd/shadow.py
@@ -76,7 +76,10 @@ class ShadowRequest(common.Request):
def convert(self, dn, attributes, parameters):
names = attributes['uid']
- passwd = attributes['userPassword'][0]
+ try:
+ passwd = attributes['userPassword'][0]
+ except IndexError:
+ passwd = None
if not passwd or self.calleruid != 0:
passwd = '*'
# function for making an int