named-checkconf.c revision 92551304a9abff9284de5b79a48e83d781989339
/*
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkconf.c,v 1.13 2001/09/04 00:32:30 marka Exp $ */
#include <config.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <isc/commandline.h>
#include "check-tool.h"
#define CHECK(r)\
do { \
result = (r); \
if (result != ISC_R_SUCCESS) \
goto cleanup; \
} while (0)
static void
usage(void) {
exit(1);
}
static isc_result_t
char *directory;
/*
* Change directory.
*/
if (result != ISC_R_SUCCESS) {
"change directory to '%s' failed: %s",
return (result);
}
return (ISC_R_SUCCESS);
}
static isc_result_t
const char *zclass;
const char *zname;
const char *zfile;
if (!cfg_obj_isstring(classobj))
else
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_FAILURE);
}
static isc_result_t
{
else
{
}
return (result);
}
static isc_result_t
const char *vclass;
{
vclass = "IN";
if (cfg_obj_isstring(classobj))
}
}
return (result);
}
int
int c;
int exit_status = 0;
switch (c) {
case 'd':
debug++;
break;
case 't':
if (result != ISC_R_SUCCESS) {
exit(1);
}
if (result != ISC_R_SUCCESS) {
exit(1);
}
break;
case 'v':
exit(0);
case 'z':
break;
default:
usage();
}
}
exit(1);
if (result != ISC_R_SUCCESS)
exit_status = 1;
if (load_zones) {
if (result != ISC_R_SUCCESS)
exit_status = 1;
}
return (exit_status);
}