X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=unmaintained%2Fgpgwrapper;fp=unmaintained%2Fgpgwrapper;h=108f981e67d78e9b6c6eafd6ec0de41232d9d09a;hb=4eaa444b9eb4c9d24cd2790f99a690054bf2f806;hp=793a52430d181e8157680143dc1b87f67fd2877f;hpb=fe67fab54bca15f4820e4f0a911023ed10a743b7;p=mirror%2Fuserdir-ldap.git diff --git a/unmaintained/gpgwrapper b/unmaintained/gpgwrapper index 793a524..108f981 100755 --- a/unmaintained/gpgwrapper +++ b/unmaintained/gpgwrapper @@ -126,7 +126,7 @@ ErrType = EX_TEMPFAIL; try: # Startup the replay cache ErrType = EX_TEMPFAIL; - if ReplayCacheFile != None: + if ReplayCacheFile is not None: ErrMsg = "Failed to initialize the replay cache:"; RC = ReplayCache(ReplayCacheFile); RC.Clean(); @@ -145,7 +145,7 @@ try: ErrMsg = "Unable to check the signature or the signature was invalid:"; Res = GPGCheckSig(Msg[0]); - if Res[0] != None: + if Res[0] is not None: raise Error, Res[0]; if Res[3] is None: @@ -164,15 +164,15 @@ try: PlainText = Res[3]; # Check the signature against the replay cache - if ReplayCacheFile != None: + if ReplayCacheFile is not None: ErrMsg = "The replay cache rejected your message. Check your clock!"; Rply = RC.Check(Res[1]); - if Rply != None: + if Rply is not None: raise Error, Rply; RC.Add(Res[1]); # Do LDAP stuff - if LDAPDn != None: + if LDAPDn is not None: CheckLDAP(Res[2][1]); # Determine the sender address @@ -195,7 +195,7 @@ try: # Invoke the child Child = os.popen(" ".join(arguments),"w"); Child.write(PlainText); - if Child.close() != None: + if Child.close() is not None: raise Error, "Child gave a non-zero return code"; except: @@ -219,7 +219,7 @@ except: # Try to send the bounce try: - if ErrorTemplate != None: + if ErrorTemplate is not None: ErrReply = TemplateSubst(Subst,open(ErrorTemplate,"r").read()); else: ErrReply = "\n"+str(Subst)+"\n"; @@ -227,7 +227,7 @@ except: Child = os.popen("/usr/sbin/sendmail -t","w"); Child.write(ErrReplyHead); Child.write(ErrReply); - if Child.close() != None: + if Child.close() is not None: raise Error, "Sendmail gave a non-zero return code"; except: sys.exit(EX_TEMPFAIL);