* Build the search path
*/
if (lwc->searchnxt > 0) {
- if (lwc->searchnxt > 0) {
- CHECK(buffer_putstr(&b, "\tsearch {\n"));
- for (i = 0; i < lwc->searchnxt; i++) {
- CHECK(buffer_putstr(&b, "\t\t\""));
- CHECK(buffer_putstr(&b, lwc->search[i]));
- CHECK(buffer_putstr(&b, "\";\n"));
- }
- CHECK(buffer_putstr(&b, "\t};\n"));
+ CHECK(buffer_putstr(&b, "\tsearch {\n"));
+ for (i = 0; i < lwc->searchnxt; i++) {
+ CHECK(buffer_putstr(&b, "\t\t\""));
+ CHECK(buffer_putstr(&b, lwc->search[i]));
+ CHECK(buffer_putstr(&b, "\";\n"));
}
+ CHECK(buffer_putstr(&b, "\t};\n"));
}
/*
}
#endif
}
- }
#ifdef HAVE_LMDB
- /*
- * If we're using LMDB, we may have created newzones databases
- * as root, making it impossible to reopen them later after
- * switching to a new userid. We close them now, and reopen
- * after relinquishing privileges them.
- */
- if (first_time) {
+ /*
+ * If we're using LMDB, we may have created newzones
+ * databases as root, making it impossible to reopen
+ * them later after switching to a new userid. We
+ * close them now, and reopen after relinquishing
+ * privileges them.
+ */
for (view = ISC_LIST_HEAD(server->viewlist);
- view != NULL;
- view = ISC_LIST_NEXT(view, link))
+ view != NULL; view = ISC_LIST_NEXT(view, link))
{
nzd_env_close(view);
}
- }
#endif /* HAVE_LMDB */
- /*
- * Relinquish root privileges.
- */
- if (first_time) {
+ /*
+ * Relinquish root privileges.
+ */
ns_os_changeuser();
}
* information regarding copyright ownership.
*/
-/* $Id: acache.c,v 1.22 2008/02/07 23:46:54 tbox Exp $ */
-
#include <config.h>
#include <isc/atomic.h>
dns_db_closeversion(db, &version, false);
/* Set DB node. */
if (node != NULL) {
+ dns_rdataset_t *ardataset, *crdataset;
+
INSIST(db != NULL);
dns_db_attachnode(db, node, &entry->node);
- }
-
- /*
- * Set list of the corresponding rdatasets, if given.
- * To minimize the overhead and memory consumption, we'll do this for
- * positive cache only, in which case the DB node is non NULL.
- * We do not want to cache incomplete information, so give up the
- * entire entry when a memory shortage happen during the process.
- */
- if (node != NULL) {
- dns_rdataset_t *ardataset, *crdataset;
+ /*
+ * Set list of the corresponding rdatasets, if
+ * given. To minimize the overhead and memory
+ * consumption, we'll do this for positive cache
+ * only, in which case the DB node is non NULL. We
+ * do not want to cache incomplete information, so
+ * give up the entire entry when a memory shortage
+ * happen during the process.
+ */
entry->foundname = isc_mem_get(acache->mctx,
sizeof(*entry->foundname));
* information regarding copyright ownership.
*/
-/* $Id: getipnode.c,v 1.47 2009/09/01 23:47:45 tbox Exp $ */
-
/*! \file */
/**
if (af == AF_INET6)
cp += 12;
n = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
- if (n == LWRES_R_SUCCESS)
+ if (n == LWRES_R_SUCCESS) {
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
- if (n == LWRES_R_SUCCESS)
+
n = lwres_getnamebyaddr(lwrctx, LWRES_ADDRTYPE_V4,
INADDRSZ, cp, &by);
+ }
if (n != LWRES_R_SUCCESS) {
lwres_conf_clear(lwrctx);
lwres_context_destroy(&lwrctx);
}
n = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
- if (n == LWRES_R_SUCCESS)
+ if (n == LWRES_R_SUCCESS) {
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
- if (n == LWRES_R_SUCCESS)
n = lwres_getnamebyaddr(lwrctx, LWRES_ADDRTYPE_V6, IN6ADDRSZ,
src, &by);
+ }
if (n != 0) {
lwres_conf_clear(lwrctx);
lwres_context_destroy(&lwrctx);
* information regarding copyright ownership.
*/
-/* $Id$ */
-
/*! \file */
/*
}
n = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
- if (n == 0)
+ if (n == 0) {
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
- if (n == 0)
n = lwres_getnamebyaddr(lwrctx, lwf,
(uint16_t)afd->a_addrlen,
addr, &by);
+ }
if (n == 0) {
if (flags & NI_NOFQDN) {
p = strchr(by->realname, '.');
confdata->resdebug = 1;
} else if (strcmp("no_tld_query", word) == 0) {
confdata->no_tld_query = 1;
- } else if (strcmp("debug", word) == 0) {
- confdata->resdebug = 1;
} else if (strncmp("ndots:", word, 6) == 0) {
ndots = strtol(word + 6, &p, 10);
if (*p != '\0') /* Bad string. */