Description
Since I have installed the latest MoinMoin update (1.5.6), new pages are created with permission 600 instead of 660.
Steps to reproduce
- Edit or create a new page.
- Check the file permission.
Example
For example, after editing (for the first time), the WikiSandBox, I get :
# ls -l * -rw-r--r-- 1 www-data www-data 9 2007-01-01 16:44 current -rw------- 1 www-data www-data 97 2007-01-01 16:44 edit-log attachments: total 16 -rw-r--r-- 1 www-data www-data 4066 2006-12-03 10:47 mytest.draw -rw-r--r-- 1 www-data www-data 479 2006-12-03 10:47 mytest.map -rw-r--r-- 1 www-data www-data 4899 2006-12-03 10:47 mytest.png cache: total 16 -rw------- 1 www-data www-data 14 2007-01-01 16:44 pagelinks -rw------- 1 www-data www-data 10900 2007-01-01 16:44 text_html revisions: total 8 -rw-r--r-- 1 www-data www-data 1334 2006-12-03 10:47 00000001 -rw------- 1 www-data www-data 1342 2007-01-01 16:44 00000002
Component selection
- general
Details
MoinMoin Version |
1.5.6 |
OS and Version |
Debian Stable |
Python Version |
2.3.5 |
Server Setup |
TwistedWeb |
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
French |
Workaround
Manually change file permissions after each update
Discussion
Please check what you use as umask on OS level for the user the wiki server process runs as (see shell / user profile script).
We do a umask call from python at the beginning of moin startup, but I guess we can't make the umask less restrictive than it already is.
I am closing this "bug" now, if that hint doesn't solve your problem, please reopen it.
I did already check this. The default umask for the user used for MoinMoin is 022.
su - www-data www-data@benji1:~$ umask 0022
I also tried to add a "umask 000" to the MoinMoin starting script, but that did not improve the situation.
I am therefore reopening this "bug". Thanks. -- JeanPhilippeGuƩrard 2007-01-01 23:04:05
- Can you please call umask from a cgi script called in the same way as moin.cgi(?) is and report the result?
- I tried to reproduce this problem using moin.cgi instead of twisted, but the permissions are correct when using moin.cgi.
- Your twistedweb stuff really runs from user www-data and is not started from root?
- Yes.
- Maybe you could add some code to the place where we call os.umask to log the return value / success of it.
- Done. The umask is correctly set as 0000.
- you checked that after the os.umask call in request.py?
- Sorry. I read too quickly. I checked the umask just before calling mointwisted. The call to os.umask is successful. The return value I get is 7.
- you checked that after the os.umask call in request.py?
- Done. The umask is correctly set as 0000.
Also, I would like to point out that I am depending on the permissions being correct to backup my MoinMoin installation. It was working fine before version 1.5.6 and I now get permission errors for all newly edited pages.
- That stuff was changed some time ago to clean and speed up the code. Before that "single os.umask" method, there was os.chmod cluttered all over the place (and sometimes forgotten) that forced the files to some specific mode. On big public wikis, we had big trouble with I/O performance, so removing all those calls was a good thing. I do not understand yet why it doesn't work for twisted. Maybe there is some interfering code in twisted or some problem with thread generation. Maybe I have some time later to do a test setup and debug this.
Meanwhile maybe try to move the os.umask call from the module level of request.py (that only runs once, when request is first imported) the RequestBase.init() or .run() - that runs once for each request processed.
twistd does some hardcoded os.umask(077) call when daemonizing the app, please try running it with -n (nodaemon) and report back if file modes are as expected then.
I get correct permissions when using twisted in nodaemon mode. -- JeanPhilippeGuƩrard 2007-01-02 18:32:13
- The proposed patch solve the issue. Thanks.
Maybe not exactly the same, but I was finding that files in the cache directories has the wrong permissions. My hack was to add os.chmod(fname, 0660 & config.umask) to CacheEntry.update() in caching.py after filesys.rename(tmp_fname, fname). nothing else worked for me. -- -- DavidMoore 2007-01-28 19:13:36
Plan
- Priority:
Assigned to: ThomasWaldmann
- Status: fixed in moin 1.5 branch (see changeset 797:677333d377c1) - summary: reset our umask on every request, should fix umask problems with twistd