Fix default Maildir File permissions.

open() and os.open() lead to different file permissions by default, and
while we have not changed the os.open that had been used, some code
changes led to these permissions slipping through. Fix this by setting
the permissions explicitly to 0666 (minus the users umask).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-19 09:25:48 +02:00
parent 0d3303ec12
commit f5366343b9
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ Changes
Bug Fixes
---------
* New emails are not created with "-rwxr-xr-x" but as "-rw-r--r--"
anymore, fixing a regression in 6.3.4.
Pending for the next major release
==================================

View File

@ -238,7 +238,7 @@ class MaildirFolder(BaseFolder):
# open file and write it out
try:
fd = os.open(os.path.join(tmpdir, messagename),
os.O_EXCL|os.O_CREAT|os.O_WRONLY)
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0666)
except OSError, e:
if e.errno == 17:
#FILE EXISTS ALREADY