summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1998-09-11 05:29:47 +0000
committerWarner Losh <imp@FreeBSD.org>1998-09-11 05:29:47 +0000
commit77740e7e347f5bfbf2531ceb70f77f3ff260a39e (patch)
treee53110b1c8a991a072bb47e2b1d85ae6acf5ade3
parent9bbfa41541553c1898713b370845f3f864d0f26f (diff)
Notes
-rw-r--r--lib/libc/db/btree/bt_open.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c
index 5fc316872dd5..1b034ce5d025 100644
--- a/lib/libc/db/btree/bt_open.c
+++ b/lib/libc/db/btree/bt_open.c
@@ -388,10 +388,11 @@ tmp()
{
sigset_t set, oset;
int fd;
- char *envtmp;
+ char *envtmp = NULL;
char path[MAXPATHLEN];
- envtmp = getenv("TMPDIR");
+ if (issetugid() == 0)
+ envtmp = getenv("TMPDIR");
(void)snprintf(path,
sizeof(path), "%s/bt.XXXXXX", envtmp ? envtmp : "/tmp");