First casualty of making pledge "dns" mandatory for dns users.
authorderaadt <deraadt@openbsd.org>
Sun, 18 Oct 2015 03:39:37 +0000 (03:39 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 18 Oct 2015 03:39:37 +0000 (03:39 +0000)
"dns" was missing, and this was relying on "inet" support..

usr.bin/ftp/main.c
usr.bin/ftp/util.c

index 6b7dc34..6fa66f1 100644 (file)
@@ -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
index 7d2d9dd..14c4da0 100644 (file)
@@ -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",