diff options
author | Warner Losh <imp@FreeBSD.org> | 1999-08-21 17:56:44 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 1999-08-21 17:56:44 +0000 |
commit | 028aace8e1e18186192d02ee3abc594e55009e8c (patch) | |
tree | 5fceed60b1009c271f9b088f1dab70b05cd728fc /lib/libc/stdio/tmpnam.c | |
parent | d00275330d377eb0a7bcb5fb597813fcbaf53ce0 (diff) |
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.
Notes
Notes:
svn path=/head/; revision=50121
Diffstat (limited to 'lib/libc/stdio/tmpnam.c')
-rw-r--r-- | lib/libc/stdio/tmpnam.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libc/stdio/tmpnam.c b/lib/libc/stdio/tmpnam.c index ce86482f3387..d0aed481387a 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; |