Hello-
We, in coordination with one of our users have developed a small patch for TMDA-CGI. This patch checks the input for any errors before saving the file. Any errors generated are returned to the user, and the file not saved. This will make sure that the filters are correct, especially important on the outgoing filter which will cause tmda-ofmipd to fail silently if wrong.
Heres a diff on EditFilter.py from tmda-cgi-0.13
30a31
> from TMDA import FilterParser
72c73
< F = open(Filename, "w")
---
> F = open(Filename+"-temp", "w")
75c76,84
< T["FileContents"] = Contents
---
> try:
> testParser = FilterParser.FilterParser()
> testParser.read(Filename+"-temp")
> F = open(Filename, "w")
> F.write(Contents)
> F.close()
> T["FileContents"] = Contents
> except Exception, ErrStr:
> CgiUtil.TermError("Syntax Error in Filter", "Parse Error in filter file you edited", "save filter", "%s" % (ErrStr), "Edit the filter file again, and double check for mistakes.")
If you have any questions, let me know.
Thanks.
--Photocon
Conrad Hunziker III
NightSky Hosting
http://www.nightskyhosting.com/
Domain Account Manager: http://manage.nightskyhosting.com/
FAQ: http://faq.nightskyhosting.com/
_____________________________________________ tmda-users mailing list ([email protected]) http://tmda.net/lists/listinfo/tmda-users
