aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/tempnam.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/tempnam.c')
-rw-r--r--lib/libc/stdio/tempnam.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/libc/stdio/tempnam.c b/lib/libc/stdio/tempnam.c
index 2d7bd90e08a4..a3e6c6e3cf01 100644
--- a/lib/libc/stdio/tempnam.c
+++ b/lib/libc/stdio/tempnam.c
@@ -29,12 +29,6 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
@@ -60,7 +54,7 @@ tempnam(const char *dir, const char *pfx)
if (!pfx)
pfx = "tmp.";
- if (issetugid() == 0 && (f = getenv("TMPDIR"))) {
+ if ((f = secure_getenv("TMPDIR")) != NULL) {
(void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
*(f + strlen(f) - 1) == '/'? "": "/", pfx);
if ((f = _mktemp(name)))