From 61bdf123c30ff94346dc23eb6bc241997efc21d6 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Sun, 13 Oct 2002 11:22:16 +0000 Subject: [PATCH] Ignore TMPDIR if the application is setugid. MFC after: 2 weeks --- lib/libc/stdio/tmpfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c index 0c98ad3ee25..b38e0bca83b 100644 --- a/lib/libc/stdio/tmpfile.c +++ b/lib/libc/stdio/tmpfile.c @@ -61,7 +61,8 @@ tmpfile() char *buf; const char *tmpdir; - tmpdir = getenv("TMPDIR"); + if (issetugid() == 0) + tmpdir = getenv("TMPDIR"); if (tmpdir == NULL) tmpdir = _PATH_TMP;