From: deraadt Date: Sun, 18 Oct 2015 03:39:37 +0000 (+0000) Subject: First casualty of making pledge "dns" mandatory for dns users. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8d84ca39822d4ed30d52b2d54a9ce38004e75be5;p=openbsd First casualty of making pledge "dns" mandatory for dns users. "dns" was missing, and this was relying on "inet" support.. --- diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 6b7dc346fd1..6fa66f18fbe 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.103 2015/10/16 05:35:19 doug Exp $ */ +/* $OpenBSD: main.c,v 1.104 2015/10/18 03:39:37 deraadt Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -444,21 +444,21 @@ main(volatile int argc, char *argv[]) if (isurl(argv[0])) { if (pipeout) { #ifndef SMALL - if (pledge("stdio rpath tty inet fattr", + if (pledge("stdio rpath dns tty inet fattr", NULL) == -1) err(1, "pledge"); #else - if (pledge("stdio rpath tty inet proc exec fattr", + if (pledge("stdio rpath dns tty inet proc exec fattr", NULL) == -1) err(1, "pledge"); #endif } else { #ifndef SMALL - if (pledge("stdio rpath wpath cpath tty inet fattr", + if (pledge("stdio rpath wpath cpath dns tty inet fattr", NULL) == -1) err(1, "pledge"); #else - if (pledge("stdio rpath wpath cpath tty inet proc exec fattr", + if (pledge("stdio rpath wpath cpath dns tty inet proc exec fattr", NULL) == -1) err(1, "pledge"); #endif diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 7d2d9dd3807..14c4da0f361 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.73 2015/10/18 03:04:11 mmcc Exp $ */ +/* $OpenBSD: util.c,v 1.74 2015/10/18 03:39:37 deraadt Exp $ */ /* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */ /*- @@ -390,8 +390,7 @@ remglob2(char *argv[], int doswitch, char **errbuf, FILE **ftemp, char *type) if (*ftemp == NULL) { int len; - if ((cp = getenv("TMPDIR")) == NULL || *cp == '\0') - cp = _PATH_TMP; + cp = _PATH_TMP; len = strlen(cp); if (len + sizeof(TMPFILE) + (cp[len-1] != '/') > sizeof(temp)) { warnx("unable to create temporary file: %s",