X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=gpgwrapper;h=87ce6329dec7ecfa68e5b091232cf20b5ccc6792;hp=10f5d726db45d2cdab82db3d2cc2480ae87e6ca2;hb=a6fb69805c3999a85c064a96c93417bb1c284c5c;hpb=3ec1386cd62200a1d86fc72168c2aa1fe305bdd8 diff --git a/gpgwrapper b/gpgwrapper index 10f5d72..87ce632 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; @@ -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";