Message2445
While setting up config.ini, the user is offered a setting to control the umask of the files written by Roundup-based trackers (per tracker).
This Umask is not fully respected by all FileStorage-derivates (MySQL and Postgres is affected, AnyDBM seems to set umask, but with an exception mentioned later.)
I'm attaching a proposed patch that seems to take care of the problem, greatly improving the behavior in Unix environments. (Especially my combination of postfix and mod_python under apache httpd.)
The solution ensure that files written using FileStorage, are always written using the correct umask.
A couple of details:
* It may be questionable whether umask should actually be set before _every_ call to open() (and, whether the open-call instead should not be called with an inverse of the umask, leaving the per-process-settings untouched. The problem with NOT setting umask per-write, is that different trackers, OR different applications running in the same process (in the apache mod_python-case) might desire different umasks. The proposed approach is the "better safe than sorry"-way, ensuring that at least python-trackers will produce files with the expected permissions. (Might not be thread-safe though???)
* AnyDBM, as mentioned above, did in fact set umask, BUT only did it once per process. The proposed patch might make line 101 of back_anydbm.py "os.umask(config.UMASK)" superfluous, but since i don't fully know the AnyDBM-code (some files are written out of FileStorage), i did not dare to touch.
Hope this patch is of some joy to someone. |
|
Date |
User |
Action |
Args |
2009-02-03 14:22:06 | admin | link | issue1744328 messages |
2009-02-03 14:22:06 | admin | create | |
|