X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-echelon;h=6c07a0ab5eb13baa6a69e2b557ff693678d54800;hb=192b08454e66c7c753f47c1b4be1d89c5feac6c8;hp=5e98afc8216529adc96f8caeca3af0e8c6e609d2;hpb=2525bf73603cb6487cfcea096e2dc347ad360394;p=mirror%2Fuserdir-ldap.git diff --git a/ud-echelon b/ud-echelon index 5e98afc..6c07a0a 100755 --- a/ud-echelon +++ b/ud-echelon @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- mode: python -*- import userdir_gpg, userdir_ldap, sys, traceback, time, ldap, os, getopt; -import string, pwd +import pwd from userdir_gpg import *; from userdir_ldap import *; @@ -22,7 +22,7 @@ def TryGPG(Email): ErrLog.write(S); return None; - if string.find(Msg[0],"-----BEGIN PGP SIGNED MESSAGE-----") == -1: + if Msg[0].find("-----BEGIN PGP SIGNED MESSAGE-----") == -1: return None; Res = GPGCheckSig(Msg[0]); @@ -34,7 +34,7 @@ def TryGPG(Email): return None; # Search for the matching key fingerprint - Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=" + Res[2][1]); + Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyFingerPrint=" + Res[2][1]); if len(Attrs) == 0: return None; if len(Attrs) != 1: @@ -94,10 +94,10 @@ try: ErrType = EX_TEMPFAIL; ErrMsg = "An error occured while performing the LDAP lookup"; global l; - l = ldap.open(LDAPServer); + l = connectLDAP() if Debug == None: F = open(PassDir+"/pass-"+pwd.getpwuid(os.getuid())[0],"r"); - AccessPass = string.split(string.strip(F.readline())," "); + AccessPass = F.readline().strip().split(" ") l.simple_bind_s("uid="+AccessPass[0]+","+BaseDn,AccessPass[1]); F.close(); else: