diff options
author | kris <kris@FreeBSD.org> | 2002-10-13 11:22:16 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2002-10-13 11:22:16 +0000 |
commit | 71c7a4a40e1ec3a79c70d9b7c71180fadc2ed309 (patch) | |
tree | fec1c5d0224529df565ad6c4425eaab6495cc290 /lib | |
parent | a803330bc2d76622da8bdbfb6f8fd116741ae020 (diff) | |
download | FreeBSD-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.c | 3 |
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; |