projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't need group read on rtc-password files
[mirror/userdir-ldap.git]
/
userdir_ldap.py
diff --git
a/userdir_ldap.py
b/userdir_ldap.py
index
9e99899
..
b559199
100644
(file)
--- a/
userdir_ldap.py
+++ b/
userdir_ldap.py
@@
-52,6
+52,17
@@
try:
except AttributeError:
UseSSL = False;
except AttributeError:
UseSSL = False;
+try:
+ BaseBaseDn = ConfModule.basebasedn;
+except AttributeError:
+ BaseBaseDn = BaseDn
+
+try:
+ IgnoreUsersForUIDNumberGen = ConfModule.ignoreusersforuidnumbergen
+except AttributeError:
+ IgnoreUsersForUIDNumberGen = ['nobody']
+
+
# Break up the keyring list
userdir_gpg.SetKeyrings(ConfModule.keyrings.split(":"))
# Break up the keyring list
userdir_gpg.SetKeyrings(ConfModule.keyrings.split(":"))
@@
-126,7
+137,10
@@
def passwdAccessLDAP(BaseDn, AdminUser):
"""
print "Accessing LDAP directory as '" + AdminUser + "'";
while (1):
"""
print "Accessing LDAP directory as '" + AdminUser + "'";
while (1):
- Password = getpass.getpass(AdminUser + "'s password: ")
+ if 'LDAP_PASSWORD' in os.environ:
+ Password = os.environ['LDAP_PASSWORD']
+ else:
+ Password = getpass.getpass(AdminUser + "'s password: ")
if len(Password) == 0:
sys.exit(0)
if len(Password) == 0:
sys.exit(0)
@@
-138,6
+152,9
@@
def passwdAccessLDAP(BaseDn, AdminUser):
try:
l.simple_bind_s(UserDn,Password);
except ldap.INVALID_CREDENTIALS:
try:
l.simple_bind_s(UserDn,Password);
except ldap.INVALID_CREDENTIALS:
+ if 'LDAP_PASSWORD' in os.environ:
+ print "password in environment does not work"
+ del os.environ['LDAP_PASSWORD']
continue
break
return l
continue
break
return l