diff MoinMoin/caching.py @ 1898:b5e94fec8669

caching: mkstemp uses 0600 to create files, we need chmod to change them to our preferred file mode
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Mar 2007 23:06:11 +0100
parents 2a4caa295346
children bb2e053067fb
line wrap: on
line diff
--- a/MoinMoin/caching.py	Sun Mar 18 20:31:42 2007 +0100
+++ b/MoinMoin/caching.py	Sun Mar 18 23:06:11 2007 +0100
@@ -9,6 +9,7 @@
 import os
 import tempfile
 
+from MoinMoin import config
 from MoinMoin.util import filesys, lock, pickle, PICKLE_PROTOCOL
 
 
@@ -118,6 +119,7 @@
                     os.close(tmp_handle)
                     # this is either atomic or happening with real locks set:
                     filesys.rename(tmp_fname, fname)
+                    filesys.chmod(fname, 0666 & config.umask) # fix mode that mkstemp chose
                 finally:
                     if self.locking:
                         self.wlock.release()