From 2417f18be8a75368304bb91232ff630666c06fdf Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 1 Dec 2000 02:01:26 +0000 Subject: [PATCH] emulate the BIND 8 kludge of setting the query logging flag default depending on whether a 'queries' log channel has been defined --- bin/named/server.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/named/server.c b/bin/named/server.c index 8c62358da0..c3521acba3 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.264 2000/11/30 20:47:53 gson Exp $ */ +/* $Id: server.c,v 1.265 2000/12/01 02:01:26 gson Exp $ */ #include @@ -1753,6 +1753,24 @@ load_configuration(const char *filename, ns_server_t *server, "config file"); } + /* + * Set the default value of the query logging flag depending + * whether a "queries" category has been defined. This is + * a disgusting hack, but we need to do this for BIND 8 + * compatibility. + */ + if (first_time) { + dns_c_logginglist_t *clog = NULL; + dns_c_logcat_t *ccat; + (void)dns_c_ctx_getlogging(cctx, &clog); + for (ccat = ISC_LIST_HEAD(clog->categories); + ccat != NULL; + ccat = ISC_LIST_NEXT(ccat, next)) { + if (strcmp(ccat->catname, "queries") == 0) + server->log_queries = ISC_TRUE; + } + } + if (dns_c_ctx_getpidfilename(cctx, &pidfilename) != ISC_R_NOTFOUND) ns_os_writepidfile(pidfilename); else if (ns_g_lwresdonly)