2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 23:55:27 +00:00

The lwresd -C option had a few problems.

This commit is contained in:
Brian Wellington
2000-10-13 22:35:46 +00:00
parent 7b438bdb9b
commit 0df9b6e53b
3 changed files with 23 additions and 9 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: globals.h,v 1.45 2000/10/04 23:19:00 bwelling Exp $ */ /* $Id: globals.h,v 1.46 2000/10/13 22:35:46 bwelling Exp $ */
#ifndef NAMED_GLOBALS_H #ifndef NAMED_GLOBALS_H
#define NAMED_GLOBALS_H 1 #define NAMED_GLOBALS_H 1
@@ -76,6 +76,7 @@ EXTERN const char * lwresd_g_conffile INIT(NS_SYSCONFDIR
"/lwresd.conf"); "/lwresd.conf");
EXTERN const char * lwresd_g_resolvconffile INIT("/etc" EXTERN const char * lwresd_g_resolvconffile INIT("/etc"
"/resolv.conf"); "/resolv.conf");
EXTERN isc_boolean_t lwresd_g_useresolvconf INIT(ISC_FALSE);
/* /*
* Misc. * Misc.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: main.c,v 1.88 2000/10/04 23:18:56 bwelling Exp $ */ /* $Id: main.c,v 1.89 2000/10/13 22:35:43 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -280,6 +280,7 @@ parse_command_line(int argc, char *argv[]) {
/* XXXBEW Should -C be removed? */ /* XXXBEW Should -C be removed? */
case 'C': case 'C':
lwresd_g_resolvconffile = isc_commandline_argument; lwresd_g_resolvconffile = isc_commandline_argument;
lwresd_g_useresolvconf = ISC_TRUE;
break; break;
case 'd': case 'd':
ns_g_debuglevel = parse_int(isc_commandline_argument, ns_g_debuglevel = parse_int(isc_commandline_argument,

View File

@@ -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.228 2000/10/12 21:51:46 mws Exp $ */ /* $Id: server.c,v 1.229 2000/10/13 22:35:45 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -1283,19 +1283,31 @@ load_configuration(const char *filename, ns_server_t *server,
callbacks.optscbk = options_callback; callbacks.optscbk = options_callback;
callbacks.optscbkuap = NULL; callbacks.optscbkuap = NULL;
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_INFO, "loading configuration from '%s'",
filename);
/* /*
* Parse the configuration file creating a parse tree. Any * Parse the configuration file creating a parse tree. Any
* 'zone' statements are handled immediately by calling * 'zone' statements are handled immediately by calling
* configure_zone() through 'callbacks'. * configure_zone() through 'callbacks'.
*/ */
cctx = NULL; cctx = NULL;
result = dns_c_parse_namedconf(filename, ns_g_mctx, &cctx, &callbacks); if (ns_g_lwresdonly && lwresd_g_useresolvconf)
if (result == ISC_R_FILENOTFOUND && ns_g_lwresdonly) result = ISC_R_FILENOTFOUND;
else {
isc_log_write(ns_g_lctx,
NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_INFO, "loading configuration from '%s'",
filename);
result = dns_c_parse_namedconf(filename, ns_g_mctx, &cctx,
&callbacks);
}
if (result == ISC_R_FILENOTFOUND && ns_g_lwresdonly) {
isc_log_write(ns_g_lctx,
NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_INFO, "loading configuration from '%s'",
lwresd_g_resolvconffile);
result = ns_lwresd_parseresolvconf(ns_g_mctx, &cctx); result = ns_lwresd_parseresolvconf(ns_g_mctx, &cctx);
}
CHECK(result); CHECK(result);
/* /*