summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isc/commandline.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-12-16 16:16:22 +0000
committerderaadt <deraadt@openbsd.org>2019-12-16 16:16:22 +0000
commit2fc5abb04c862f358e234358caea4444e15db068 (patch)
tree1c77d5b577fef0399be14245b2108ca9c1a8819d /usr.sbin/bind/lib/isc/commandline.c
parentNeed to include message size in the maximum buffer calculation. (diff)
downloadwireguard-openbsd-2fc5abb04c862f358e234358caea4444e15db068.tar.xz
wireguard-openbsd-2fc5abb04c862f358e234358caea4444e15db068.zip
Update to bind-9.10.5-P3, which appears to have been the last ISC version.
We only use this tree to build dig and nslookup. Our previous version predated edns0 support in those tools, and we want that. This is the worst code I've looked at in years, with layers and layers of spaghetti abstraction clearly unfit for reuse, but then reused anyways, and the old ones remain behind. So this is a 8MB diff. florian, sthen, and otto tried this merge before but failed.
Diffstat (limited to 'usr.sbin/bind/lib/isc/commandline.c')
-rw-r--r--usr.sbin/bind/lib/isc/commandline.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/bind/lib/isc/commandline.c b/usr.sbin/bind/lib/isc/commandline.c
index 57c4eb8f9cd..4f034e92053 100644
--- a/usr.sbin/bind/lib/isc/commandline.c
+++ b/usr.sbin/bind/lib/isc/commandline.c
@@ -1,8 +1,8 @@
/*
- * Portions Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 2004, 2005, 2007, 2008, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2001 Internet Software Consortium.
*
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -27,11 +27,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -48,7 +44,7 @@
* SUCH DAMAGE.
*/
-/* $ISC: commandline.c,v 1.16.18.2 2005/04/29 00:16:45 marka Exp $ */
+/* $Id: commandline.c,v 1.6 2019/12/16 16:16:25 deraadt Exp $ */
/*! \file
* This file was adapted from the NetBSD project's source tree, RCS ID:
@@ -69,6 +65,7 @@
#include <isc/commandline.h>
#include <isc/msgs.h>
+#include <isc/print.h>
#include <isc/string.h>
#include <isc/util.h>
@@ -98,7 +95,7 @@ static char endopt = '\0';
int
isc_commandline_parse(int argc, char * const *argv, const char *options) {
static char *place = ENDOPT;
- char *option; /* Index into *options of option. */
+ const char *option; /* Index into *options of option. */
REQUIRE(argc >= 0 && argv != NULL && options != NULL);
@@ -107,7 +104,10 @@ isc_commandline_parse(int argc, char * const *argv, const char *options) {
* the previous argv was finished.
*/
if (isc_commandline_reset || *place == '\0') {
- isc_commandline_reset = ISC_FALSE;
+ if (isc_commandline_reset) {
+ isc_commandline_index = 1;
+ isc_commandline_reset = ISC_FALSE;
+ }
if (isc_commandline_progname == NULL)
isc_commandline_progname = argv[0];