[issue21207] urandom persistent fd - not re-openned after fd close

Steven Hiscocks report at bugs.python.org
Tue Apr 15 00:08:24 CEST 2014


Steven Hiscocks added the comment:

Just to add for those interested: a possible work around solution is using "os.path.sameopenfile" to check fds against another known fd for urandom.

And for those wish to have a bit of fun (and maybe a security consideration):
python -c "import os;os.urandom(1);os.closerange(3,256);fd = open('/dev/zero');print(os.urandom(10))"
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

----------

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


More information about the Python-bugs-list mailing list