Message285320
The putwin() function uses mkstemp() with the path template /tmp/py.curses.getwin.XXXXXX.
I would prefer to use the Python function tempfile.mkstemp(). This function has a more portable behaviour. For example, Python is able to atomatically make the file descriptor non-inherirable if the OS supports this feature.
I suggest to expect a file descriptor in the C putwin() and write a Python putwin() which expects a file and pass file.fileno() if available, or use tempfile.TemporaryFile().
tempfile.TemporaryFile is even more secure because the file is not accessible from the regular file system on most platforms. This function is able to use the secure Linux O_TMPFILE flag and the O_TEMPORARY flag on Windows. |
|
Date |
User |
Action |
Args |
2017-01-12 13:16:23 | vstinner | set | recipients:
+ vstinner, twouters, xdegaye, serhiy.storchaka, yan12125 |
2017-01-12 13:16:23 | vstinner | set | messageid: <1484226983.22.0.935847428584.issue29176@psf.upfronthosting.co.za> |
2017-01-12 13:16:23 | vstinner | link | issue29176 messages |
2017-01-12 13:16:22 | vstinner | create | |
|