summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2001-08-18 18:52:10 (GMT)
committerSkip Montanaro <skip@pobox.com>2001-08-18 18:52:10 (GMT)
commit95618b5bc98ca9f30ed9dd2e4382fd737bbbbc6c (patch)
treed2a34d310069b2461dda4de906299ec9415500e5 /Modules/posixmodule.c
parent50d756e262fc6804336e5a624aee0d885a195973 (diff)
downloadcpython-95618b5bc98ca9f30ed9dd2e4382fd737bbbbc6c.zip
cpython-95618b5bc98ca9f30ed9dd2e4382fd737bbbbc6c.tar.gz
cpython-95618b5bc98ca9f30ed9dd2e4382fd737bbbbc6c.tar.bz2
added warnings about security risk of using tmpnam and tempnam
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0f4148b..403bae1 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -4211,6 +4211,11 @@ posix_tempnam(PyObject *self, PyObject *args)
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);
#else
@@ -4258,6 +4263,11 @@ posix_tmpnam(PyObject *self, PyObject *args)
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);
#else