X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-generate;h=6c699288156149b77643affc9b5d8f5f83469e33;hb=752375f69108be4b4b8898fad9e5f777277d8b06;hp=6116cd0dda796134c2b54b3bf735541e7e51994a;hpb=5ccf0b31849a9d7a2be2377c05cbe0b015606716;p=mirror%2Fuserdir-ldap.git diff --git a/ud-generate b/ud-generate index 6116cd0..6c69928 100755 --- a/ud-generate +++ b/ud-generate @@ -28,7 +28,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, sha, shutil, errno, tarfile, grp +import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, hashlib, shutil, errno, tarfile, grp import lockfile from userdir_ldap import * from userdir_exceptions import * @@ -781,7 +781,7 @@ def ExtractDNSInfo(x): Algorithm = 2 if Algorithm == None: continue - Fingerprint = sha.new(base64.decodestring(Split[1])).hexdigest() + Fingerprint = hashlib.new('sha1', base64.decodestring(Split[1])).hexdigest() DNSInfo.append("%sIN\tSSHFP\t%u 1 %s" % (TTLprefix, Algorithm, Fingerprint)) if 'architecture' in x[1]: @@ -997,7 +997,7 @@ def GenKeyrings(OutDir): def get_accounts(ldap_conn): # Fetch all the users - passwd_attrs = ldap_conn.search_s(BaseDn, ldap.SCOPE_ONELEVEL, "(&(uid=*)(!(uidNumber=0)))",\ + passwd_attrs = ldap_conn.search_s(BaseDn, ldap.SCOPE_ONELEVEL, "(&(uid=*)(!(uidNumber=0))(objectClass=shadowAccount))",\ ["uid", "uidNumber", "gidNumber", "supplementaryGid",\ "gecos", "loginShell", "userPassword", "shadowLastChange",\ "shadowMin", "shadowMax", "shadowWarning", "shadowInactive",