[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.195,2.196
Skip Montanaro
montanaro@users.sourceforge.net
Sat, 18 Aug 2001 11:52:12 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv25014
Modified Files:
posixmodule.c
Log Message:
added warnings about security risk of using tmpnam and tempnam
Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.195
retrieving revision 2.196
diff -C2 -d -r2.195 -r2.196
*** posixmodule.c 2001/07/26 13:41:05 2.195
--- posixmodule.c 2001/08/18 18:52:10 2.196
***************
*** 4212,4215 ****
--- 4212,4220 ----
if (!PyArg_ParseTuple(args, "|zz:tempnam", &dir, &pfx))
return NULL;
+
+ if (PyErr_Warn(PyExc_RuntimeWarning,
+ "tempnam is a potential security risk to your program") < 0)
+ return NULL;
+
#ifdef MS_WIN32
name = _tempnam(dir, pfx);
***************
*** 4259,4262 ****
--- 4264,4272 ----
if (!PyArg_ParseTuple(args, ":tmpnam"))
return NULL;
+
+ if (PyErr_Warn(PyExc_RuntimeWarning,
+ "tmpnam is a potential security risk to your program") < 0)
+ return NULL;
+
#ifdef USE_TMPNAM_R
name = tmpnam_r(buffer);