summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/stdio/tmpfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c
index 0c98ad3..b38e0bc 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;
OpenPOWER on IntegriCloud