[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.195,2.195.2.1

Guido van Rossum gvanrossum@users.sourceforge.net
Sat, 18 Aug 2001 22:20:24 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv23914

Modified Files:
      Tag: r22a2-branch
	posixmodule.c 
Log Message:
Merge Skip's warnings for tmpnam into the 2.2a2 branch

Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.195
retrieving revision 2.195.2.1
diff -C2 -d -r2.195 -r2.195.2.1
*** posixmodule.c	2001/07/26 13:41:05	2.195
--- posixmodule.c	2001/08/19 05:20:22	2.195.2.1
***************
*** 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);