summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2015-11-13 18:13:13 +0000
committerderaadt <>2015-11-13 18:13:13 +0000
commit90df0c5f081a9ff7e6e051eb8807d786b33b957a (patch)
tree4d9c01ee64f61b577ad36cce01ec52424710b9c9
parent4998141acb59d8c785142a7461b96cd15df02eaa (diff)
downloadopenbsd-90df0c5f081a9ff7e6e051eb8807d786b33b957a.tar.gz
openbsd-90df0c5f081a9ff7e6e051eb8807d786b33b957a.tar.bz2
openbsd-90df0c5f081a9ff7e6e051eb8807d786b33b957a.zip
Since rtable was hoisted to the top with setrtable, it should have no
bearing on the following pledge setups anymore. ok benno
-rw-r--r--src/usr.bin/nc/netcat.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index 8860bac824..ae2404bd0d 100644
--- a/src/usr.bin/nc/netcat.c
+++ b/src/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: netcat.c,v 1.142 2015/11/12 20:33:52 benno Exp $ */ 1/* $OpenBSD: netcat.c,v 1.143 2015/11/13 18:13:13 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * Copyright (c) 2015 Bob Beck. All rights reserved. 4 * Copyright (c) 2015 Bob Beck. All rights reserved.
@@ -310,23 +310,20 @@ main(int argc, char *argv[])
310 argc -= optind; 310 argc -= optind;
311 argv += optind; 311 argv += optind;
312 312
313 if (rtableid >= 0) { 313 if (rtableid >= 0)
314 if (setrtable(rtableid) == -1) 314 if (setrtable(rtableid) == -1)
315 err(1, "setrtable"); 315 err(1, "setrtable");
316 } 316
317 if (family == AF_UNIX) { 317 if (family == AF_UNIX) {
318 if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) 318 if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)
319 err(1, "pledge"); 319 err(1, "pledge");
320 } 320 } else if (Fflag) {
321 else if (Fflag) {
322 if (pledge("stdio inet dns sendfd", NULL) == -1) 321 if (pledge("stdio inet dns sendfd", NULL) == -1)
323 err(1, "pledge"); 322 err(1, "pledge");
324 } 323 } else if (usetls) {
325 else if (usetls) {
326 if (pledge("stdio rpath inet dns", NULL) == -1) 324 if (pledge("stdio rpath inet dns", NULL) == -1)
327 err(1, "pledge"); 325 err(1, "pledge");
328 } 326 } else if (pledge("stdio inet dns", NULL) == -1)
329 else if (pledge("stdio inet dns", NULL) == -1)
330 err(1, "pledge"); 327 err(1, "pledge");
331 328
332 /* Cruft to make sure options are clean, and used properly. */ 329 /* Cruft to make sure options are clean, and used properly. */
@@ -830,7 +827,7 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
830 827
831 if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) 828 if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0)
832 break; 829 break;
833 else if (vflag) 830 if (vflag)
834 warn("connect to %s port %s (%s) failed", host, port, 831 warn("connect to %s port %s (%s) failed", host, port,
835 uflag ? "udp" : "tcp"); 832 uflag ? "udp" : "tcp");
836 833