summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-18 03:41:14 +0000
committerderaadt <deraadt@openbsd.org>2015-10-18 03:41:14 +0000
commit7a146a5dec4558f2a6fcaea7be1a45dddeb1d4a2 (patch)
tree47387f5d907d48c5fbd754822963b04b740c742e
parentFirst casualty of making pledge "dns" mandatory for dns users. (diff)
downloadwireguard-openbsd-7a146a5dec4558f2a6fcaea7be1a45dddeb1d4a2.tar.xz
wireguard-openbsd-7a146a5dec4558f2a6fcaea7be1a45dddeb1d4a2.zip
unrelated commit; not ready yet
-rw-r--r--usr.bin/ftp/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c
index 14c4da0f361..e2470670b4a 100644
--- a/usr.bin/ftp/util.c
+++ b/usr.bin/ftp/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.74 2015/10/18 03:39:37 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.75 2015/10/18 03:41:14 deraadt Exp $ */
/* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */
/*-
@@ -390,7 +390,8 @@ remglob2(char *argv[], int doswitch, char **errbuf, FILE **ftemp, char *type)
if (*ftemp == NULL) {
int len;
- cp = _PATH_TMP;
+ if ((cp = getenv("TMPDIR")) == NULL || *cp == '\0')
+ cp = _PATH_TMP;
len = strlen(cp);
if (len + sizeof(TMPFILE) + (cp[len-1] != '/') > sizeof(temp)) {
warnx("unable to create temporary file: %s",