Commit 0df9b6e5 authored by Brian Wellington's avatar Brian Wellington
Browse files

The lwresd -C option had a few problems.

parent 7b438bdb
......@@ -15,7 +15,7 @@
* 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
#define NAMED_GLOBALS_H 1
......@@ -76,6 +76,7 @@ EXTERN const char * lwresd_g_conffile INIT(NS_SYSCONFDIR
"/lwresd.conf");
EXTERN const char * lwresd_g_resolvconffile INIT("/etc"
"/resolv.conf");
EXTERN isc_boolean_t lwresd_g_useresolvconf INIT(ISC_FALSE);
/*
* Misc.
......
......@@ -15,7 +15,7 @@
* 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>
......@@ -280,6 +280,7 @@ parse_command_line(int argc, char *argv[]) {
/* XXXBEW Should -C be removed? */
case 'C':
lwresd_g_resolvconffile = isc_commandline_argument;
lwresd_g_useresolvconf = ISC_TRUE;
break;
case 'd':
ns_g_debuglevel = parse_int(isc_commandline_argument,
......
......@@ -15,7 +15,7 @@
* 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>
......@@ -1283,19 +1283,31 @@ load_configuration(const char *filename, ns_server_t *server,
callbacks.optscbk = options_callback;
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
* 'zone' statements are handled immediately by calling
* configure_zone() through 'callbacks'.
*/
cctx = NULL;
result = dns_c_parse_namedconf(filename, ns_g_mctx, &cctx, &callbacks);
if (result == ISC_R_FILENOTFOUND && ns_g_lwresdonly)
if (ns_g_lwresdonly && lwresd_g_useresolvconf)
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);
}
CHECK(result);
/*
......
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