Commit e7c0d42b authored by Evan Hunt's avatar Evan Hunt

[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
code on API version mismatch, leading to a segfault.
[RT #35495]
......
......@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.c,v 1.142 2012/02/03 22:27:17 each Exp $ */
/*! \file */
/*
......@@ -88,6 +86,7 @@ static char *args;
static char program[256];
static isc_socket_t *sock = NULL;
static isc_uint32_t serial;
static isc_boolean_t quiet = ISC_FALSE;
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) {
result = isccc_cc_lookupstring(data, "text", &textmsg);
if (result == ISC_R_SUCCESS) {
if (strlen(textmsg) != 0U)
printf("%s\n", textmsg);
if ((!quiet || failed) && strlen(textmsg) != 0U)
fprintf(failed ? stderr : stdout, "%s\n", textmsg);
} else if (result != ISC_R_NOTFOUND)
fprintf(stderr, "%s: parsing response failed: %s\n",
progname, isc_result_totext(result));
......@@ -727,8 +726,8 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
int
main(int argc, char **argv) {
isc_boolean_t show_final_mem = ISC_FALSE;
isc_result_t result = ISC_R_SUCCESS;
isc_boolean_t show_final_mem = ISC_FALSE;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *task = NULL;
isc_log_t *log = NULL;
......@@ -761,7 +760,7 @@ main(int argc, char **argv) {
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) {
switch (ch) {
case 'b':
......@@ -800,6 +799,10 @@ main(int argc, char **argv) {
isc_commandline_argument);
break;
case 'q':
quiet = ISC_TRUE;
break;
case 's':
servername = isc_commandline_argument;
break;
......
......@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.conf,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
/*
* Sample rndc configuration file.
*/
......
......@@ -58,6 +58,7 @@
<arg><option>-k <replaceable class="parameter">key-file</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>-a</option></arg>
<arg><option>-V</option></arg>
<arg><option>-y <replaceable class="parameter">key_id</replaceable></option></arg>
<arg choice="req">command</arg>
......@@ -164,6 +165,16 @@
</listitem>
</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>
<term>-V</term>
<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