aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi
diff options
context:
space:
mode:
authorbwarsaw <>2005-05-02 21:31:00 +0000
committerbwarsaw <>2005-05-02 21:31:00 +0000
commit9c4a53e6ffaa5835b88a8f40d2b5c95ee170f648 (patch)
treeb7a8ff2d8770c0fce5e6da481c5f0e9eb90c4700 /Mailman/Cgi
parent76e9f8fbee0865be1564e099cd5b90187406bad8 (diff)
downloadmailman2-9c4a53e6ffaa5835b88a8f40d2b5c95ee170f648.tar.gz
mailman2-9c4a53e6ffaa5835b88a8f40d2b5c95ee170f648.tar.xz
mailman2-9c4a53e6ffaa5835b88a8f40d2b5c95ee170f648.zip
ChangeHTML(): Set umask to 0 while creating the langdir. Fixes SF bug
#1190404
Diffstat (limited to 'Mailman/Cgi')
-rw-r--r--Mailman/Cgi/edithtml.py10
1 files changed, 7 insertions, 3 deletions
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)