summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/tmpnam.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-08-21 17:56:44 +0000
committerimp <imp@FreeBSD.org>1999-08-21 17:56:44 +0000
commit019ef99305239293158eb2df6f4780465957b216 (patch)
tree9f2e9b90fa22a2216615af7bb943b95da48ef86b /lib/libc/stdio/tmpnam.c
parentcdea47dc6eedf22eb73e5b4675affbc31669814e (diff)
downloadFreeBSD-src-019ef99305239293158eb2df6f4780465957b216.zip
FreeBSD-src-019ef99305239293158eb2df6f4780465957b216.tar.gz
Add warnings, ala mktemp, to tempnam and tmpnam as a reminder that
these are inherently unsafe interfaces. Do not allow TMPDIR to override path for setuid/setgid programs.
Diffstat (limited to 'lib/libc/stdio/tmpnam.c')
-rw-r--r--lib/libc/stdio/tmpnam.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libc/stdio/tmpnam.c b/lib/libc/stdio/tmpnam.c
index ce86482..d0aed48 100644
--- a/lib/libc/stdio/tmpnam.c
+++ b/lib/libc/stdio/tmpnam.c
@@ -43,6 +43,11 @@ static char sccsid[] = "@(#)tmpnam.c 8.3 (Berkeley) 3/28/94";
#include <stdio.h>
#include <unistd.h>
+__warn_references(tmpnam,
+ "warning: tmpnam() possibly used unsafely; consider using mkstemp()");
+
+extern char *_mktemp __P((char *));
+
char *
tmpnam(s)
char *s;
OpenPOWER on IntegriCloud