# Some routines and configuration that are used by the ldap progams
import termios, TERMIOS, re, string, imp, ldap, sys, whrandom, crypt, rfc822;
+import userdir_gpg
try:
File = open("/etc/userdir-ldap/userdir-ldap.conf");
Ech_ErrorLog = ConfModule.ech_errorlog;
Ech_MainLog = ConfModule.ech_mainlog;
+# Break up the keyring list
+userdir_gpg.SetKeyrings(string.split(ConfModule.keyrings,":"));
+
# This is a list of common last-name prefixes
LastNamesPre = {"van": None, "le": None, "de": None, "di": None};
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Rand = open("/dev/urandom");
Password = "";
- for i in range(0,10):
+ for i in range(0,15):
Password = Password + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)];
return Password;
# glibc then just change Salt = "$1$" to Salt = "";
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Salt = "$1$";
+ Rand = open("/dev/urandom");
for x in range(0,10):
- Salt = Salt + SaltVals[whrandom.randint(0,len(SaltVals)-1)];
+ Salt = Salt + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)];
Pass = crypt.crypt(Password,Salt);
if len(Pass) < 14:
raise "Password Error", "MD5 password hashing failed, not changing the password!";