mkstemp vs. tmpnam , tempnam

Janet zptang at hotmail.com
Fri Sep 21 16:21:22 EDT 2001


Hi,

I downloaded and installed python 2.1.1.  However, when I use the
Python/C API, the following warning message appear:

/usr/local/src/Python-2.1.1/libpython2.1.a(posixmodule.o): In function
`posix_tmpnam':
/usr/local/src/Python-2.1.1/./Modules/posixmodule.c:4231: the use of
`tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/src/Python-2.1.1/libpython2.1.a(posixmodule.o): In function
`posix_tempnam':
/usr/local/src/Python-2.1.1/./Modules/posixmodule.c:4170: the use of
`tempnam' is dangerous, better use `mkstemp'

I am running it on Linux, Mandrake 8.0.  Both tmpnam and tempnam are
considered unsafe.  Is there a patch for this problem or I can just
modified the Modules/posixmodule.c to use msktemp instead?

Thanks,



More information about the Python-list mailing list