X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=gpgwrapper;h=cf252262915b4b62d6d99107983e6ecb0a323069;hb=595923978a9ad55f4ec55b1aabef44683b111911;hp=10f5d726db45d2cdab82db3d2cc2480ae87e6ca2;hpb=b006d85551df4a7116824f6430b67e563ebac587;p=mirror%2Fuserdir-ldap.git diff --git a/gpgwrapper b/gpgwrapper index 10f5d72..cf25226 100755 --- a/gpgwrapper +++ b/gpgwrapper @@ -41,7 +41,7 @@ # -e /etc/userdir-ldap/templtes/error-reply -- test.sh import sys, traceback, time, os; -import string, pwd, getopt; +import pwd, getopt; from userdir_gpg import *; EX_TEMPFAIL = 75; @@ -85,7 +85,7 @@ def CheckLDAP(FingerPrint): ErrType = EX_TEMPFAIL; ErrMsg = "An error occured while performing the LDAP lookup"; global l; - l = ldap.open(LDAPServer); + l = connectLDAP(LDAPServer); l.simple_bind_s("",""); # Search for the matching key fingerprint @@ -107,7 +107,7 @@ for (switch, val) in options: elif (switch == '-e'): ErrorTemplate = val; elif (switch == '-k'): - SetKeyrings(string.split(val,":")); + SetKeyrings(val.split(":")); elif (switch == '-a'): ReplyTo = val; elif (switch == '-d'): @@ -138,7 +138,7 @@ try: Msg = GetClearSig(Email); ErrMsg = "Message is not PGP signed:" - if string.find(Msg[0],"-----BEGIN PGP SIGNED MESSAGE-----") == -1: + if Msg[0].find("-----BEGIN PGP SIGNED MESSAGE-----") == -1: raise Error, "No PGP signature"; # Check the signature @@ -156,9 +156,9 @@ try: ErrMsg = "Problem stripping MIME headers from the decoded message" if Msg[1] == 1: try: - Index = string.index(Res[3],"\n\n") + 2; + Index = Res[3].index("\n\n") + 2; except ValueError: - Index = string.index(Res[3],"\n\r\n") + 3; + Index = Res[3].index("\n\r\n") + 3; PlainText = Res[3][Index:]; else: PlainText = Res[3]; @@ -193,7 +193,7 @@ try: os.environ["REPLYTO"] = Sender; # Invoke the child - Child = os.popen(string.join(arguments," "),"w"); + Child = os.popen(" ".join(arguments),"w"); Child.write(PlainText); if Child.close() != None: raise Error, "Child gave a non-zero return code";