[issue3228] mailbox.mbox creates files with execute bit set

Niels Gustäbel report at bugs.python.org
Sat Aug 2 12:01:34 CEST 2008


Niels Gustäbel <niels at gustaebel.de> added the comment:

The problem is not limited to mboxes but also applies to maildirs. Any
message file created inside a maildir has execute permissions set as
well because the same function _create_carefully() is used.

Changing the umask is not an option because it also affects any folders
that are created. Setting the umask to something like 0177 would render
the base folder and the {new,cur,tmp} folders of a newly created Maildir
unusable.

To me the only solution is changing the _create_carefully() function, so
that it provides a mode argument to os.open() as done in the attached patch.

The patch also fixes another instance of this problem: the empty file
"maildirfolder" which is created inside a maildir's base folder. It
should not be executable as well.

----------
keywords: +patch
nosy: +ngustaebel
Added file: http://bugs.python.org/file11037/python-mailbox-patch.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3228>
_______________________________________


More information about the Python-bugs-list mailing list