diff options
author | joe <joe@FreeBSD.org> | 2000-12-17 19:49:07 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2000-12-17 19:49:07 +0000 |
commit | 0449442242597d58974a27bcb6217c8798ae9499 (patch) | |
tree | 98ca97f0091586a90df8e43796bccf56f0eedcd9 /usr.sbin/crunch | |
parent | cb3b526426b2dad39a9c614005fc80e682658374 (diff) | |
download | FreeBSD-src-0449442242597d58974a27bcb6217c8798ae9499.zip FreeBSD-src-0449442242597d58974a27bcb6217c8798ae9499.tar.gz |
Use one of the TMPDIR env variable or _PATH_TMP instead of hardcoding
/tmp.
Submitted by: jedgar
Diffstat (limited to 'usr.sbin/crunch')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunchgen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index c87dffe..5fcdb3a 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -34,6 +34,7 @@ */ #include <ctype.h> #include <err.h> +#include <paths.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -172,7 +173,8 @@ int main(int argc, char **argv) if(!*execfname) snprintf(execfname, sizeof(execfname), "%s", confname); snprintf(cachename, sizeof(cachename), "%s.cache", confname); - snprintf(tempfname, sizeof(tempfname), "/tmp/crunchgen_%sXXXXXX", confname); + snprintf(tempfname, sizeof(tempfname), "%s/crunchgen_%sXXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, confname); parse_conf_file(); if (list_mode) |