diff --git a/CHANGES b/CHANGES index 3378792e90..19cd70fc0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3335. [func] nslookup: return a nonzero exit code when unable + to get an answer. [RT #29492] + 3333. [bug] Setting resolver-query-timeout too low can cause named to not recover if it loses connectivity. [RT #29623] diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 48c390b8ae..2ef8f84ea2 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -57,6 +57,7 @@ static isc_boolean_t in_use = ISC_FALSE; static char defclass[MXRD] = "IN"; static char deftype[MXRD] = "A"; static isc_event_t *global_event = NULL; +static int query_error = 1, print_error = 0; static char domainopt[DNS_NAME_MAXTEXT]; @@ -406,6 +407,9 @@ isc_result_t printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { char servtext[ISC_SOCKADDR_FORMATSIZE]; + /* I've we've gotten this far, we've reached a server. */ + query_error = 0; + debug("printmessage()"); isc_sockaddr_format(&query->sockaddr, servtext, sizeof(servtext)); @@ -433,6 +437,9 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { (msg->rcode != dns_rcode_nxdomain) ? nametext : query->lookup->textname, rcode_totext(msg->rcode)); debug("returning with rcode == 0"); + + /* the lookup failed */ + print_error |= 1; return (ISC_R_SUCCESS); } @@ -887,5 +894,5 @@ main(int argc, char **argv) { destroy_libs(); isc_app_finish(); - return (0); + return (query_error | print_error); } diff --git a/bin/named/config.c b/bin/named/config.c index dc7ae9c80e..9e453ade3b 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/bin/tests/resolver/t_resolver.c b/bin/tests/resolver/t_resolver.c index 7e3838604b..c5726f93c6 100644 --- a/bin/tests/resolver/t_resolver.c +++ b/bin/tests/resolver/t_resolver.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/doc/private/SRCID b/doc/private/SRCID index f725bd7788..a346939c7a 100644 --- a/doc/private/SRCID +++ b/doc/private/SRCID @@ -1,4 +1,4 @@ # This file must follow /bin/sh rules. It is imported directly via # configure. # -SRCID="( 2012/06/08 03:15:00 UTC )" +SRCID="( 2012/06/09 00:15:00 UTC )" diff --git a/util/copyrights b/util/copyrights index 64a993619d..21873d3c31 100644 --- a/util/copyrights +++ b/util/copyrights @@ -70,7 +70,7 @@ ./bin/dig/host.html HTML DOCBOOK ./bin/dig/include/dig/dig.h C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011 ./bin/dig/nslookup.1 MAN DOCBOOK -./bin/dig/nslookup.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 +./bin/dig/nslookup.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 ./bin/dig/nslookup.docbook SGML 2004,2005,2006,2007,2010 ./bin/dig/nslookup.html HTML DOCBOOK ./bin/dig/win32/dig.dsp X 2001,2002,2004,2005,2006,2009 @@ -142,7 +142,7 @@ ./bin/named/bindkeys.pl PERL 2009,2010,2011 ./bin/named/builtin.c C 2001,2002,2003,2004,2005,2007,2009,2010,2011,2012 ./bin/named/client.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 -./bin/named/config.c C 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 +./bin/named/config.c C 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 ./bin/named/control.c C 2001,2002,2003,2004,2005,2006,2007,2009,2010 ./bin/named/controlconf.c C 2001,2002,2003,2004,2005,2006,2007,2008,2011,2012 ./bin/named/convertxsl.pl PERL 2006,2007,2008 @@ -500,7 +500,7 @@ ./bin/tests/rdata_test.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2011 ./bin/tests/resolv.conf.sample CONF-SH 2000,2001,2004,2007 ./bin/tests/resolver/Makefile.in MAKE 2011 -./bin/tests/resolver/t_resolver.c C 2011 +./bin/tests/resolver/t_resolver.c C 2011,2012 ./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007 ./bin/tests/serial_test.c C 1999,2000,2001,2003,2004,2007 ./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011