changeset 180:e73843b02d9d

remove support for setting umask If you need to set the umask, you should do this e.g. using your web/wsgi server configuration, so it starts the moin wsgi app with that umask already been set. AFAICS, the usual wsgi servers provide an option to set the umask. Note: the removed code was a relict being left over from moin < 1.9, due to some bug in some server software we even (re-)set the umask PER REQUEST. I don't think that it is needed any more. If you think / experience differently, please file an issue in the moin2 issue tracker - after you have made sure that you can't solve your problem on the wsgi server level.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 22 Apr 2011 18:04:48 +0200
parents 939013ce69fe
children 87b5f10a8b01
files MoinMoin/app.py MoinMoin/config/__init__.py MoinMoin/util/filesys.py
diffstat 3 files changed, 0 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/app.py	Sat Apr 16 02:28:39 2011 +0200
+++ b/MoinMoin/app.py	Fri Apr 22 18:04:48 2011 +0200
@@ -163,18 +163,6 @@
 from MoinMoin import auth, config, user
 
 
-def set_umask(new_mask=0777^config.umask):
-    """ Set the OS umask value (and ignore potential failures on OSes where
-        this is not supported).
-        Default: the bitwise inverted value of config.umask
-    """
-    try:
-        old_mask = os.umask(new_mask)
-    except:
-        # maybe we are on win32?
-        pass
-
-
 def init_backends(app):
     """ initialize the backend """
     # A ns_mapping consists of several lines, where each line is made up like this:
@@ -279,9 +267,6 @@
     flaskg.clock.start('total')
     flaskg.clock.start('init')
     try:
-        set_umask() # do it once per request because maybe some server
-                    # software sets own umask
-
         flaskg.unprotected_storage = app.unprotected_storage
 
         try:
--- a/MoinMoin/config/__init__.py	Sat Apr 16 02:28:39 2011 +0200
+++ b/MoinMoin/config/__init__.py	Fri Apr 22 18:04:48 2011 +0200
@@ -15,9 +15,6 @@
                        'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
                        'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', )
 
-# When creating files, we use e.g. 0666 & config.umask for the mode:
-umask = 0770
-
 # Charset - we support only 'utf-8'. While older encodings might work,
 # we don't have the resources to test them, and there is no real
 # benefit for the user. IMPORTANT: use only lowercase 'utf-8'!
--- a/MoinMoin/util/filesys.py	Sat Apr 16 02:28:39 2011 +0200
+++ b/MoinMoin/util/filesys.py	Fri Apr 22 18:04:48 2011 +0200
@@ -20,7 +20,6 @@
 
 def chmod(name, mode, catchexception=True):
     """ change mode of some file/dir on platforms that support it.
-        usually you don't need this because we use os.umask() in app init
     """
     try:
         os.chmod(name, mode)