summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2002-10-13 11:22:16 +0000
committerkris <kris@FreeBSD.org>2002-10-13 11:22:16 +0000
commit71c7a4a40e1ec3a79c70d9b7c71180fadc2ed309 (patch)
treefec1c5d0224529df565ad6c4425eaab6495cc290 /lib
parenta803330bc2d76622da8bdbfb6f8fd116741ae020 (diff)
downloadFreeBSD-src-71c7a4a40e1ec3a79c70d9b7c71180fadc2ed309.zip
FreeBSD-src-71c7a4a40e1ec3a79c70d9b7c71180fadc2ed309.tar.gz
Ignore TMPDIR if the application is setugid.
MFC after: 2 weeks
Diffstat (limited to 'lib')
-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