Commit e7c0d42b authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] rndc -q

3776.	[bug]		"rndc -q" suppresses output from successful
			rndc commands. Errors are printed on stderr.
                        [RT #21393]
parent 7d769b7b
3776. [bug] "rndc -q" suppresses output from successful
rndc commands. Errors are printed on stderr.
[RT #21393]
3775. [bug] dlz_dlopen driver could return the wrong error 3775. [bug] dlz_dlopen driver could return the wrong error
code on API version mismatch, leading to a segfault. code on API version mismatch, leading to a segfault.
[RT #35495] [RT #35495]
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: rndc.c,v 1.142 2012/02/03 22:27:17 each Exp $ */
/*! \file */ /*! \file */
/* /*
...@@ -88,6 +86,7 @@ static char *args; ...@@ -88,6 +86,7 @@ static char *args;
static char program[256]; static char program[256];
static isc_socket_t *sock = NULL; static isc_socket_t *sock = NULL;
static isc_uint32_t serial; static isc_uint32_t serial;
static isc_boolean_t quiet = ISC_FALSE;
static void rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task); static void rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task);
...@@ -271,8 +270,8 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) { ...@@ -271,8 +270,8 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
result = isccc_cc_lookupstring(data, "text", &textmsg); result = isccc_cc_lookupstring(data, "text", &textmsg);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
if (strlen(textmsg) != 0U) if ((!quiet || failed) && strlen(textmsg) != 0U)
printf("%s\n", textmsg); fprintf(failed ? stderr : stdout, "%s\n", textmsg);
} else if (result != ISC_R_NOTFOUND) } else if (result != ISC_R_NOTFOUND)
fprintf(stderr, "%s: parsing response failed: %s\n", fprintf(stderr, "%s: parsing response failed: %s\n",
progname, isc_result_totext(result)); progname, isc_result_totext(result));
...@@ -727,8 +726,8 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname, ...@@ -727,8 +726,8 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
int int
main(int argc, char **argv) { main(int argc, char **argv) {
isc_boolean_t show_final_mem = ISC_FALSE;
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
isc_boolean_t show_final_mem = ISC_FALSE;
isc_taskmgr_t *taskmgr = NULL; isc_taskmgr_t *taskmgr = NULL;
isc_task_t *task = NULL; isc_task_t *task = NULL;
isc_log_t *log = NULL; isc_log_t *log = NULL;
...@@ -761,7 +760,7 @@ main(int argc, char **argv) { ...@@ -761,7 +760,7 @@ main(int argc, char **argv) {
isc_commandline_errprint = ISC_FALSE; isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, "b:c:hk:Mmp:s:Vy:")) while ((ch = isc_commandline_parse(argc, argv, "b:c:hk:Mmp:qs:Vy:"))
!= -1) { != -1) {
switch (ch) { switch (ch) {
case 'b': case 'b':
...@@ -800,6 +799,10 @@ main(int argc, char **argv) { ...@@ -800,6 +799,10 @@ main(int argc, char **argv) {
isc_commandline_argument); isc_commandline_argument);
break; break;
case 'q':
quiet = ISC_TRUE;
break;
case 's': case 's':
servername = isc_commandline_argument; servername = isc_commandline_argument;
break; break;
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: rndc.conf,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
/* /*
* Sample rndc configuration file. * Sample rndc configuration file.
*/ */
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<arg><option>-k <replaceable class="parameter">key-file</replaceable></option></arg> <arg><option>-k <replaceable class="parameter">key-file</replaceable></option></arg>
<arg><option>-s <replaceable class="parameter">server</replaceable></option></arg> <arg><option>-s <replaceable class="parameter">server</replaceable></option></arg>
<arg><option>-p <replaceable class="parameter">port</replaceable></option></arg> <arg><option>-p <replaceable class="parameter">port</replaceable></option></arg>
<arg><option>-a</option></arg>
<arg><option>-V</option></arg> <arg><option>-V</option></arg>
<arg><option>-y <replaceable class="parameter">key_id</replaceable></option></arg> <arg><option>-y <replaceable class="parameter">key_id</replaceable></option></arg>
<arg choice="req">command</arg> <arg choice="req">command</arg>
...@@ -164,6 +165,16 @@ ...@@ -164,6 +165,16 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>-q</term>
<listitem>
<para>
Quiet mode: Message text returned by the server
will not be printed except when there is an error.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term>-V</term> <term>-V</term>
<listitem> <listitem>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment