This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author desrt
Recipients desrt
Date 2014-03-28.07:04:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395990246.32.0.278092008539.issue21082@psf.upfronthosting.co.za>
In-reply-to
Content
http://bugs.python.org/file19849/mkdirs.tr.diff introduced a patch with this code in it:

+def _get_masked_mode(mode):
+    mask = umask(0)
+    umask(mask)
+    return mode & ~mask

This changes the umask of the entire process.  If another thread manages to create a file between those two calls then it will be world read/writable, regardless of the original umask of the process.

This is not theoretical: I discovered this bug by observing it happen.
History
Date User Action Args
2014-03-28 07:04:06desrtsetrecipients: + desrt
2014-03-28 07:04:06desrtsetmessageid: <1395990246.32.0.278092008539.issue21082@psf.upfronthosting.co.za>
2014-03-28 07:04:06desrtlinkissue21082 messages
2014-03-28 07:04:05desrtcreate