mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-29 13:53:29 -04:00
2031. [bug] Emit a error message when "rndc refresh" is called on
a non slave/stub zone. [RT # 16073]
This commit is contained in:
parent
164d71038d
commit
dfbbf9bb55
2 changed files with 20 additions and 8 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
2031. [bug] Emit a error message when "rndc refresh" is called on
|
||||
a non slave/stub zone. [RT # 16073]
|
||||
|
||||
2030. [bug] We were being overly conservative when disabling
|
||||
openssl engine support. [RT #16030]
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.339.2.15.2.69 2006/02/28 06:32:53 marka Exp $ */
|
||||
/* $Id: server.c,v 1.339.2.15.2.70 2006/05/24 04:30:24 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -3460,20 +3460,29 @@ isc_result_t
|
|||
ns_server_refreshcommand(ns_server_t *server, char *args, isc_buffer_t *text) {
|
||||
isc_result_t result;
|
||||
dns_zone_t *zone = NULL;
|
||||
const unsigned char msg[] = "zone refresh queued";
|
||||
const unsigned char msg1[] = "zone refresh queued";
|
||||
const unsigned char msg2[] = "not a slave or stub zone";
|
||||
dns_zonetype_t type;
|
||||
|
||||
result = zone_from_args(server, args, &zone);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
if (zone == NULL)
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
|
||||
dns_zone_refresh(zone);
|
||||
dns_zone_detach(&zone);
|
||||
if (sizeof(msg) <= isc_buffer_availablelength(text))
|
||||
isc_buffer_putmem(text, msg, sizeof(msg));
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
type = dns_zone_gettype(zone);
|
||||
if (type == dns_zone_slave || type == dns_zone_stub) {
|
||||
dns_zone_refresh(zone);
|
||||
dns_zone_detach(&zone);
|
||||
if (sizeof(msg1) <= isc_buffer_availablelength(text))
|
||||
isc_buffer_putmem(text, msg1, sizeof(msg1));
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
dns_zone_detach(&zone);
|
||||
if (sizeof(msg2) <= isc_buffer_availablelength(text))
|
||||
isc_buffer_putmem(text, msg2, sizeof(msg2));
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
Loading…
Reference in a new issue