]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
The lwresd -C option had a few problems.
authorBrian Wellington <source@isc.org>
Fri, 13 Oct 2000 22:35:46 +0000 (22:35 +0000)
committerBrian Wellington <source@isc.org>
Fri, 13 Oct 2000 22:35:46 +0000 (22:35 +0000)
bin/named/include/named/globals.h
bin/named/main.c
bin/named/server.c

index a6e4797db6011bade9a2b6338c4eb7bb2f2542c0..d39a8a55cca73c1285339cc46cc9de1c0af990b0 100644 (file)
@@ -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.
index 57df9e2f14ea305b16aa95217ba1f2e7360dcf4d..a31f754126f957c1cb0da34729df71aa461fa766 100644 (file)
@@ -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,
index 5c27400b8b0fce7762dce96b40e1fa7b948ab62d..842ded41719bdd661ab78184bf8a630f7f63ed11 100644 (file)
@@ -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);
 
        /*