From 9c4a53e6ffaa5835b88a8f40d2b5c95ee170f648 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Mon, 2 May 2005 21:31:00 +0000 Subject: ChangeHTML(): Set umask to 0 while creating the langdir. Fixes SF bug #1190404 --- Mailman/Cgi/edithtml.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Mailman') diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py index 493763b4..756b6c34 100644 --- a/Mailman/Cgi/edithtml.py +++ b/Mailman/Cgi/edithtml.py @@ -158,10 +158,14 @@ def ChangeHTML(mlist, cgi_info, template_name, doc): code = cgi_info['html_code'].value langdir = os.path.join(mlist.fullpath(), mlist.preferred_language) # Make sure the directory exists + omask = os.umask(0) try: - os.mkdir(langdir, 02775) - except OSError, e: - if e.errno <> errno.EEXIST: raise + try: + os.mkdir(langdir, 02775) + except OSError, e: + if e.errno <> errno.EEXIST: raise + finally: + os.umask(omask) fp = open(os.path.join(langdir, template_name), 'w') try: fp.write(code) -- cgit v1.2.3