From 7c294304aff8dde66af9acbe42e0038b32ea5e44 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 6 Mar 2001 19:04:42 +0000 Subject: [PATCH] Fix a few places where the new config code would fail if there was no config file (-c /dev/null). --- bin/named/server.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 3a2b29c2f7..c78627d807 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.296 2001/03/06 02:49:29 bwelling Exp $ */ +/* $Id: server.c,v 1.297 2001/03/06 19:04:42 bwelling Exp $ */ #include @@ -1664,7 +1664,13 @@ load_configuration(const char *filename, ns_server_t *server, ns_listenlist_t *listenon = NULL; clistenon = NULL; - (void)cfg_map_get(options, "listen-on", &clistenon); + /* + * Even though listen-on is present in the default + * configuration, we can't use it here, since it isn't + * used if we're in lwresd mode. This way is easier. + */ + if (options != NULL) + (void)cfg_map_get(options, "listen-on", &clistenon); if (clistenon != NULL) { result = ns_listenlist_fromconfig(clistenon, config, @@ -1691,7 +1697,8 @@ load_configuration(const char *filename, ns_server_t *server, cfg_obj_t *clistenon = NULL; ns_listenlist_t *listenon = NULL; - (void)cfg_map_get(options, "listen-on-v6", &clistenon); + if (options != NULL) + (void)cfg_map_get(options, "listen-on-v6", &clistenon); if (clistenon != NULL) { result = ns_listenlist_fromconfig(clistenon, config, @@ -1820,7 +1827,7 @@ load_configuration(const char *filename, ns_server_t *server, /* * Load the TKEY information from the configuration. */ - { + if (options != NULL) { dns_tkeyctx_t *t = NULL; CHECKM(ns_tkeyctx_fromconfig(options, ns_g_mctx, ns_g_entropy, &t),