mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 23:55:27 +00:00
rndc [-v view] [-z zone] reload -> rndc reload [zone [view]]
Make the server not crash while I am at it.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: server.c,v 1.253 2000/11/23 02:26:37 gson Exp $ */
|
/* $Id: server.c,v 1.254 2000/11/25 03:27:53 mws Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -2113,7 +2113,7 @@ zone_from_args(char *args, dns_zone_t **zone) {
|
|||||||
dns_fixedname_t name;
|
dns_fixedname_t name;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
isc_buffer_t buf;
|
isc_buffer_t buf;
|
||||||
dns_view_t *view;
|
dns_view_t *view = NULL;
|
||||||
|
|
||||||
input = args;
|
input = args;
|
||||||
ptr = next_token(&input, " \t");
|
ptr = next_token(&input, " \t");
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: rndc.c,v 1.28 2000/11/08 19:20:03 mws Exp $ */
|
/* $Id: rndc.c,v 1.29 2000/11/25 03:27:54 mws Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Principal Author: DCL
|
* Principal Author: DCL
|
||||||
@@ -315,7 +315,7 @@ main(int argc, char **argv) {
|
|||||||
else
|
else
|
||||||
progname = *argv;
|
progname = *argv;
|
||||||
|
|
||||||
while ((ch = isc_commandline_parse(argc, argv, "c:Mmp:s:Vv:y:z:"))
|
while ((ch = isc_commandline_parse(argc, argv, "c:Mmp:s:Vy:"))
|
||||||
!= -1) {
|
!= -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'c':
|
case 'c':
|
||||||
@@ -345,15 +345,9 @@ main(int argc, char **argv) {
|
|||||||
case 'V':
|
case 'V':
|
||||||
verbose = ISC_TRUE;
|
verbose = ISC_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
|
||||||
viewname = isc_commandline_argument;
|
|
||||||
break;
|
|
||||||
case 'y':
|
case 'y':
|
||||||
keyname = isc_commandline_argument;
|
keyname = isc_commandline_argument;
|
||||||
break;
|
break;
|
||||||
case 'z':
|
|
||||||
zonename = isc_commandline_argument;
|
|
||||||
break;
|
|
||||||
case '?':
|
case '?':
|
||||||
usage();
|
usage();
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -480,17 +474,22 @@ main(int argc, char **argv) {
|
|||||||
*/
|
*/
|
||||||
ndc_g_ndc.waitresult = ISC_R_SUCCESS;
|
ndc_g_ndc.waitresult = ISC_R_SUCCESS;
|
||||||
|
|
||||||
while ((args = *argv++) != NULL &&
|
if (*argv != NULL &&
|
||||||
result == ISC_R_SUCCESS &&
|
result == ISC_R_SUCCESS &&
|
||||||
ndc_g_ndc.waitresult == ISC_R_SUCCESS) {
|
ndc_g_ndc.waitresult == ISC_R_SUCCESS) {
|
||||||
|
|
||||||
|
args = *argv;
|
||||||
|
|
||||||
/* Skip leading white space. */
|
/* Skip leading white space. */
|
||||||
args += strspn(args, " \t\r\n");
|
args += strspn(args, " \t\r\n");
|
||||||
|
|
||||||
/* Extract command */
|
/* Extract command */
|
||||||
len = strcspn(args, " \t\r\n");
|
len = strcspn(args, " \t\r\n");
|
||||||
if (len == 0)
|
if (len == 0) {
|
||||||
continue;
|
fprintf(stderr, "%s: unexpected error parsing "
|
||||||
|
"command: got %s\n", progname, args);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
command = isc_mem_get(mctx, len + 1);
|
command = isc_mem_get(mctx, len + 1);
|
||||||
if (command == NULL)
|
if (command == NULL)
|
||||||
DO("isc_mem_get", ISC_R_NOMEMORY);
|
DO("isc_mem_get", ISC_R_NOMEMORY);
|
||||||
@@ -511,6 +510,18 @@ main(int argc, char **argv) {
|
|||||||
|
|
||||||
} else if (strcmp(command, "reload") == 0) {
|
} else if (strcmp(command, "reload") == 0) {
|
||||||
char omapiargs[DNS_NAME_MAXTEXT];
|
char omapiargs[DNS_NAME_MAXTEXT];
|
||||||
|
if (argc > 0) {
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argv != NULL)
|
||||||
|
zonename = *argv;
|
||||||
|
}
|
||||||
|
if (argc > 0) {
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argv != NULL)
|
||||||
|
viewname = *argv;
|
||||||
|
}
|
||||||
omapiargs[0]=0;
|
omapiargs[0]=0;
|
||||||
if (zonename != NULL) {
|
if (zonename != NULL) {
|
||||||
strncat(omapiargs, "Z", 1);
|
strncat(omapiargs, "Z", 1);
|
||||||
@@ -534,6 +545,18 @@ main(int argc, char **argv) {
|
|||||||
result = send_command(omapimgr, command, omapiargs);
|
result = send_command(omapimgr, command, omapiargs);
|
||||||
} else if (strcmp(command, "refresh") == 0) {
|
} else if (strcmp(command, "refresh") == 0) {
|
||||||
char omapiargs[DNS_NAME_MAXTEXT];
|
char omapiargs[DNS_NAME_MAXTEXT];
|
||||||
|
if (argc > 0) {
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argv != NULL)
|
||||||
|
zonename = *argv;
|
||||||
|
}
|
||||||
|
if (argc > 0) {
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argv != NULL)
|
||||||
|
viewname = *argv;
|
||||||
|
}
|
||||||
omapiargs[0]=0;
|
omapiargs[0]=0;
|
||||||
if (zonename != NULL) {
|
if (zonename != NULL) {
|
||||||
strncat(omapiargs, "Z", 1);
|
strncat(omapiargs, "Z", 1);
|
||||||
|
Reference in New Issue
Block a user