Commit 9ee323b6 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

707. [func] The "filename" argument to named-checkzone is no

                        longer optional, to avoid reduce confusion. [RT #612]

Also some other minor cleanups of named-checkzone and its man page.
parent 3d4454cc
707. [func] The "filename" argument to named-checkzone is no
longer optional, to avoid reduce confusion. [RT #612]
706. [bug] Zones with an explicit "allow-update { none; };"
were considered dynamic and therefore not reloaded
on SIGHUP or "rndc reload".
......
......@@ -13,7 +13,7 @@
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" $Id: named-checkzone.8,v 1.3 2001/01/09 21:47:15 bwelling Exp $
.\" $Id: named-checkzone.8,v 1.4 2001/01/24 00:56:56 gson Exp $
.Dd Jun 13, 2000
.Dt NAMED-CHECKZONE 1
......@@ -26,14 +26,18 @@
.Nm named-checkzone
.Op Fl dq
.Op Fl c Ar class
.Ar zone
.Op filename
.Ar zonename
.Ar filename
.Sh DESCRIPTION
.Pp
.Nm named-checkzone
is a tool for performing integrity checks on a zones contents.
It uses the same integrity checks as
.Nm named .
checks the syntax and integrity of a zone file.
It performs the same checks as
.Nm named
does when loading a zone. This makes
.Nm named-checkzone
useful for checking zone files before
configuring them into a name server.
.Pp
The options to
.Nm named-checkzone
......@@ -46,11 +50,10 @@ quiet mode - exit code only.
.It Fl c Ar class
specify the class of the zone.
If not specified "IN" is assumed.
.It Ar zone
the name of the zone being loaded.
.It Op filename
the name of the file containing the zone.
If not specified it defaults to the zone name.
.It Ar zonename
the domain name of the zone being checked.
.It Ar filename
the name of the zone file.
.Sh RETURN VALUES
.Pp
.Nm named-checkzone
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkzone.c,v 1.10 2001/01/11 18:29:53 gson Exp $ */
/* $Id: named-checkzone.c,v 1.11 2001/01/24 00:56:55 gson Exp $ */
#include <config.h>
......@@ -61,7 +61,7 @@ static const char *dbtype[] = { "rbt" };
static void
usage(void) {
fprintf(stderr,
"usage: named-checkzone [-dq] [-c class] zone [filename]\n");
"usage: named-checkzone [-dq] [-c class] zonename filename\n");
exit(1);
}
......@@ -123,12 +123,10 @@ main(int argc, char **argv) {
int c;
char *origin = NULL;
char *filename = NULL;
char *classname;
isc_log_t *lctx = NULL;
isc_result_t result;
char classname_in[] = "IN";
classname = classname_in;
char *classname = classname_in;
while ((c = isc_commandline_parse(argc, argv, "c:dqs")) != EOF) {
switch (c) {
......@@ -146,20 +144,16 @@ main(int argc, char **argv) {
}
}
if (argv[isc_commandline_index] == NULL)
if (isc_commandline_index + 2 > argc)
usage();
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
if (!quiet)
RUNTIME_CHECK(setup_logging(mctx, &lctx) == ISC_R_SUCCESS);
origin = argv[isc_commandline_index];
isc_commandline_index++;
if (argv[isc_commandline_index] != NULL)
filename = argv[isc_commandline_index];
else
filename = origin;
result = setup(origin, filename, (char *)classname);
origin = argv[isc_commandline_index++];
filename = argv[isc_commandline_index++];
result = setup(origin, filename, classname);
if (!quiet && result == ISC_R_SUCCESS)
fprintf(stdout, "OK\n");
destroy();
......
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