Roundup Tracker - Issues

Issue 1744328

classification
Umask not used for FileStorage-backends
Type: Severity: normal
Components: Database Versions:
process
Status: closed fixed
:
: jpend : jpend, rawler
Priority: normal :

Created on 2007-06-27 16:41 by rawler, last changed 2007-09-11 21:34 by jpend.

Files
File name Uploaded Description Edit Remove
roundup-umask.diff rawler, 2007-06-27 16:41 Proposed patch
Messages
msg2445 Author: [hidden] (rawler) Date: 2007-06-27 16:41
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.
msg2446 Author: [hidden] (jpend) Date: 2007-09-11 21:34
Checked in to CVS. Sorry it took me so long.
History
Date User Action Args
2007-06-27 16:41:50rawlercreate