zoneconf.c revision 67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * Copyright (C) 1999-2003 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * Permission to use, copy, modify, and/or distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * copyright notice and this permission notice appear in all copies.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * PERFORMANCE OF THIS SOFTWARE.
d25afd60ee2286cb171c4960a790f3d7041b6f85Bob Halley/* $Id: zoneconf.c,v 1.186 2011/12/20 00:06:54 marka Exp $ */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley#include <isc/string.h> /* Required for HP/UX (and others?) */
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley/* ACLs associated with zone */
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halleytypedef enum {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley#define RETERR(x) do { \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley return (_r); \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley#define CHECK(x) do { \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Convenience function for configuring a single zone ACL.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyconfigure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const cfg_obj_t *maps[5] = {NULL, NULL, NULL, NULL, NULL};
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley /* First check to see if ACL is defined within the zone */
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley /* Failing that, see if there's a default ACL already in the view */
70fdfcd1fa7ebd059deffa9a2cecc29df96dfe52Bob Halley /* Check for default ACLs that haven't been parsed yet */
70fdfcd1fa7ebd059deffa9a2cecc29df96dfe52Bob Halley const cfg_obj_t *options = cfg_tuple_get(vconfig, "options");
95f78a208ad6dfb8359320c77ab30c670c773922Mark Andrews result = cfg_acl_fromconfig(aclobj, config, ns_g_lctx, actx,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley /* Set the view default now */
5f120ce962b03e4dcf6f1974b9b896f0fa7cacb0Bob Halley * Parse the zone update-policy statement.
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halleyconfigure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley const char *zname)
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley (void)cfg_map_get(zconfig, "update-policy", &updatepolicy);
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley strcmp("local", cfg_obj_asstring(updatepolicy)) == 0) {
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley const cfg_obj_t *stmt = cfg_listelt_value(element);
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley const cfg_obj_t *mode = cfg_tuple_get(stmt, "mode");
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
3740b569ae76295b941d57a724a43beb75b533baBob Halley const cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const char *str;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley unsigned int i, n;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = dns_name_fromtext(dns_fixedname_name(&fident), &b,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley "error copying origin: %s",
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = dns_name_fromtext(dns_fixedname_name(&fname),
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley types = isc_mem_get(mctx, n * sizeof(dns_rdatatype_t));
ce3761f64d3d734cc94605026985898900ecc474Bob Halley result = dns_rdatatype_fromtext(&types[i++], &r);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley isc_mem_put(mctx, types, n * sizeof(dns_rdatatype_t));
38d2d0e9326a2f70b5893302b89a26978b539405Bob Halley * If "update-policy local;" and a session key exists,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * then use the default policy, which is equivalent to:
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * update-policy { grant <session-keyname> zonesub any; };
00d81794884f1eee59ca058a292f2d1e50d9547cBob Halley "failed to enable auto DDNS policy "
00d81794884f1eee59ca058a292f2d1e50d9547cBob Halley "for zone %s: session key not found",
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * This is the TTL used for internally generated RRsets for static-stub zones.
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * The value doesn't matter because the mapping is static, but needs to be
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * defined for the sake of implementation.
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * Configure an apex NS with glues for a static-stub zone.
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * For example, for the zone named "example.com", the following RRs will be
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * added to the zone DB:
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * example.com. A 192.0.2.1
f18f3c93e7fecf120302658f93addae573a6e874Bob Halley * example.com. AAAA 2001:db8::1
f18f3c93e7fecf120302658f93addae573a6e874Bob Halleyconfigure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
bcfcece57e9411ee4bd352b45a8b1ac1dbcf01f4Bob Halley const cfg_obj_t *address = cfg_listelt_value(element);
bcfcece57e9411ee4bd352b45a8b1ac1dbcf01f4Bob Halley "port is not configurable for "
bcfcece57e9411ee4bd352b45a8b1ac1dbcf01f4Bob Halley "static stub server-addresses");
bcfcece57e9411ee4bd352b45a8b1ac1dbcf01f4Bob Halley "scoped address is not allowed "
1366b7833c86343de278480b9abd71754e418bfaBob Halley "for static stub "
1366b7833c86343de278480b9abd71754e418bfaBob Halley "server-addresses");
1366b7833c86343de278480b9abd71754e418bfaBob Halley rdata = isc_mem_get(mctx, sizeof(*rdata) + region.length);
bcfcece57e9411ee4bd352b45a8b1ac1dbcf01f4Bob Halley dns_rdata_fromregion(rdata, dns_zone_getclass(zone),
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * If no address is specified (unlikely in this context, but possible),
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * there's nothing to do anymore.
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley /* Add to the list an apex NS with the ns name being the origin name */
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley dns_name_toregion(dns_zone_getorigin(zone), &sregion);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley rdata = isc_mem_get(mctx, sizeof(*rdata) + sregion.length);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * Already allocated data will be freed in the caller, so
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * we can simply return here.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley memcpy(region.base, sregion.base, region.length);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_rdata_fromregion(rdata, dns_zone_getclass(zone),
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_LIST_APPEND(rdatalist_ns->rdata, rdata, link);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * Configure an apex NS with an out-of-zone NS names for a static-stub zone.
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * For example, for the zone named "example.com", something like the following
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley * RRs will be added to the zone DB:
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley * example.com. NS ns.example.net.
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halleyconfigure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley const char *str;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = dns_name_fromtext(nsname, &b, dns_rootname, 0, NULL);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "server-name '%s' is not a valid "
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (dns_name_issubdomain(nsname, dns_zone_getorigin(zone))) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "server-name '%s' must not be a "
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "subdomain of zone name '%s'",
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley rdata = isc_mem_get(mctx, sizeof(*rdata) + sregion.length);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley memcpy(region.base, sregion.base, region.length);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley dns_rdata_fromregion(rdata, dns_zone_getclass(zone),
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * Configure static-stub zone.
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halleyconfigure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_rdatalist_t rdatalist_ns, rdatalist_a, rdatalist_aaaa;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley &rdatalist_ns, &rdatalist_a, &rdatalist_aaaa, NULL
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley /* Create the DB beforehand */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley rdatalist_aaaa.rdclass = dns_zone_getclass(zone);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley /* Prepare zone RRs from the configuration */
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = cfg_map_get(zconfig, "server-addresses", &obj);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = configure_staticstub_serveraddrs(obj, zone,
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = cfg_map_get(zconfig, "server-names", &obj);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = configure_staticstub_servernames(obj, zone,
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * Sanity check: there should be at least one NS RR at the zone apex
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * to trigger delegation.
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley "No NS record is configured for a "
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * Now add NS and glue A/AAAA RRsets to the zone DB.
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * First open a new version for the add operation and get a pointer
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley * to the apex node (all RRs are of the apex name).
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_name_clone(dns_zone_getorigin(zone), &apexname);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = dns_db_findnode(db, &apexname, ISC_FALSE, &apexnode);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley /* Add NS RRset */
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley RUNTIME_CHECK(dns_rdatalist_tordataset(&rdatalist_ns, &rdataset)
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = dns_db_addrdataset(db, apexnode, dbversion, 0, &rdataset,
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley /* Add glue A RRset, if any */
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley RUNTIME_CHECK(dns_rdatalist_tordataset(&rdatalist_a, &rdataset)
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = dns_db_addrdataset(db, apexnode, dbversion, 0,
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley /* Add glue AAAA RRset, if any */
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley RUNTIME_CHECK(dns_rdatalist_tordataset(&rdatalist_aaaa,
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley result = dns_db_addrdataset(db, apexnode, dbversion, 0,
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley while ((rdata = ISC_LIST_HEAD(rdatalists[i]->rdata)) != NULL) {
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley ISC_LIST_UNLINK(rdatalists[i]->rdata, rdata, link);
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley * Convert a config file zone type into a server zone type.
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley * Helper function for strtoargv(). Pardon the gratuitous recursion.
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halleystrtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp,
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley char ***argvp, unsigned int n)
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley /* Discard leading whitespace. */
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley if (*s == '\0') {
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley /* We have reached the end of the string. */
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley char *p = s;
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley if (*p != '\0')
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley *p++ = '\0';
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley result = strtoargvsub(mctx, p, argcp, argvp, n + 1);
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews * Tokenize the string "s" into whitespace-separated words,
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews * return the number of words in '*argcp' and an array
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews * of pointers to the words in '*argvp'. The caller
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews * must free the array using isc_mem_put(). The string
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews * is modified in-place.
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrewsstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews return (strtoargvsub(mctx, s, argcp, argvp, 0));
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrewschecknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews INSIST(result == ISC_R_SUCCESS && objp != NULL && *objp != NULL);
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrewsns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews dns_notifytype_t notifytype = dns_notifytype_yes;
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews unsigned int dbargc;
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews isc_boolean_t check = ISC_FALSE, fail = ISC_FALSE;
6957b87f931bb110ba4d0adf495932691ba550b1Bob Halley isc_boolean_t warn = ISC_FALSE, ignore = ISC_FALSE;
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
aa8e34546c1e51e69f5a4935d28cb0c543e7401aAndreas Gustafsson zoptions = cfg_tuple_get(zconfig, "options");
aa8e34546c1e51e69f5a4935d28cb0c543e7401aAndreas Gustafsson maps[i++] = cfg_tuple_get(vconfig, "options");
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews (void)cfg_map_get(config, "options", &options);
29b487b0a458d655f0aad9257ca46021f4903d08Bob Halley RETERR(ns_config_getclass(cfg_tuple_get(vconfig, "class"),
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Configure values common to all zone types.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(ns_config_getclass(cfg_tuple_get(zconfig, "class"),
d2b77d720f1dcdc85a761b1de1a94d32fbdef81aBrian Wellington result = cfg_map_get(zoptions, "database", &obj);
d2b77d720f1dcdc85a761b1de1a94d32fbdef81aBrian Wellington cpval = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
5d661f0bde49c68d33eb1146d60058782aca50a7Bob Halley result = strtoargv(mctx, cpval, &dbargc, &dbargv);
5d661f0bde49c68d33eb1146d60058782aca50a7Bob Halley if (result != ISC_R_SUCCESS && cpval != default_dbtype) {
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley * ANSI C is strange here. There is no logical reason why (char **)
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley * cannot be promoted automatically to (const char * const *) by the
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley * compiler w/o generating a warning.
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley result = dns_zone_setdbtype(zone, dbargc, (const char * const *)dbargv);
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley isc_mem_put(mctx, dbargv, dbargc * sizeof(*dbargv));
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley * Unless we're using some alternative database, a master zone
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley * will be needing a master file.
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley if (ztype == dns_zone_master && cpval == default_dbtype &&
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley "zone '%s': 'file' not specified",
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley result= ns_config_get(maps, "masterfile-format", &obj);
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley const char *masterformatstr = cfg_obj_asstring(obj);
453603c018a9e7c3ee7726868f27c95798544ed7Bob Halley else if (strcasecmp(masterformatstr, "raw") == 0)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley size_t signedlen = strlen(filename) + sizeof(SIGNED);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_zone_setfile2(raw, filename, masterformat));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley (void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_zone_setfile2(zone, filename, masterformat));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj)));
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley * Notify messages are processed by the raw zone if it exists.
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley RETERR(configure_zone_acl(zconfig, vconfig, config,
3740b569ae76295b941d57a724a43beb75b533baBob Halley * XXXAG This probably does not make sense for stubs.
3740b569ae76295b941d57a724a43beb75b533baBob Halley RETERR(configure_zone_acl(zconfig, vconfig, config,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley else if (strcasecmp(dialupstr, "notify-passive") == 0)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "zone-statistics", &obj);
bd53af8229e28cfec8bfd9572b4d31514ea97f48Bob Halley * Configure master functionality. This applies
bd53af8229e28cfec8bfd9572b4d31514ea97f48Bob Halley * to primary masters (type "master") and slaves
bd53af8229e28cfec8bfd9572b4d31514ea97f48Bob Halley * acting as masters (type "slave"), but not to stubs.
bd53af8229e28cfec8bfd9572b4d31514ea97f48Bob Halley if (ztype != dns_zone_stub && ztype != dns_zone_staticstub &&
bd53af8229e28cfec8bfd9572b4d31514ea97f48Bob Halley else if (strcasecmp(notifystr, "master-only") == 0)
a41d348e14b0465c6444cdfd2d59f9370fd44fe8Mark Andrews dns_zone_setnotifytype(raw, dns_notifytype_no);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "also-notify", &obj);
08c8a934ceb2dfc6a5ebfd3be4ba5a1b3243bc73Bob Halley RETERR(ns_config_getipandkeylist(config, obj, mctx,
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley result = dns_zone_setalsonotifywithkeys(zone, addrs,
a41d348e14b0465c6444cdfd2d59f9370fd44fe8Mark Andrews result = ns_config_get(maps, "notify-source", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj)));
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
f257e9369c27578eb87077923dc010a6614e2a7aMark Andrews result = ns_config_get(maps, "notify-source-v6", &obj);
f257e9369c27578eb87077923dc010a6614e2a7aMark Andrews INSIST(result == ISC_R_SUCCESS && obj != NULL);
a41d348e14b0465c6444cdfd2d59f9370fd44fe8Mark Andrews RETERR(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj)));
a41d348e14b0465c6444cdfd2d59f9370fd44fe8Mark Andrews ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "notify-to-soa", &obj);
38d2d0e9326a2f70b5893302b89a26978b539405Bob Halley dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFYTOSOA,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setisself(zone, ns_client_isself, NULL);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(configure_zone_acl(zconfig, vconfig, config,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "max-transfer-time-out", &obj);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff dns_zone_setmaxxfrout(zone, cfg_obj_asuint32(obj) * 60);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = ns_config_get(maps, "max-transfer-idle-out", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setidleout(zone, cfg_obj_asuint32(obj) * 60);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = ns_config_get(maps, "max-journal-size", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "'max-journal-size "
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "is too large",
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley result = ns_config_get(maps, "ixfr-from-differences", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley else if (!strcasecmp(cfg_obj_asstring(obj), "master") &&
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley else if (!strcasecmp(cfg_obj_asstring(obj), "slave") &&
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(raw, DNS_ZONEOPT_IXFRFROMDIFFS,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
70fdfcd1fa7ebd059deffa9a2cecc29df96dfe52Bob Halley dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "request-ixfr", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setrequestixfr(zone, cfg_obj_asboolean(obj));
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(raw, DNS_ZONEOPT_CHECKNAMESFAIL,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMESFAIL,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMESFAIL,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "notify-delay", &obj);
38d2d0e9326a2f70b5893302b89a26978b539405Bob Halley dns_zone_setnotifydelay(zone, cfg_obj_asuint32(obj));
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley result = ns_config_get(maps, "check-sibling", &obj);
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSIBLING,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = ns_config_get(maps, "zero-no-soa-ttl", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setzeronosoattl(zone, cfg_obj_asboolean(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "nsec3-test-zone", &obj);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_NSEC3TESTZONE,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = ns_config_get(maps, "max-journal-size", &obj);
38d2d0e9326a2f70b5893302b89a26978b539405Bob Halley "'max-journal-size "
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley "is too large",
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Configure update-related options. These apply to
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * primary masters only.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(configure_zone_acl(zconfig, vconfig, config,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (updateacl != NULL && dns_acl_isinsecure(updateacl))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley isc_log_write(ns_g_lctx, DNS_LOGCATEGORY_SECURITY,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "zone '%s' allows updates by IP "
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "address, which is insecure",
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(configure_zone_ssutable(zoptions, mayberaw, zname));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley isc_boolean_t allow = ISC_FALSE, maint = ISC_FALSE;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "sig-validity-interval", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "key-directory", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(dns_zone_setkeydirectory(zone, filename));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "sig-signing-signatures", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setsignatures(zone, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "sig-signing-nodes", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "sig-signing-type", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setprivatetype(zone, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "update-check-ksk", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_UPDATECHECKKSK,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "dnssec-dnskey-kskonly", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(zone, DNS_ZONEOPT_DNSKEYKSKONLY,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = ns_config_get(maps, "dnssec-loadkeys-interval", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = cfg_map_get(zoptions, "auto-dnssec", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, allow);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, maint);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley RETERR(configure_zone_acl(zconfig, vconfig, config,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Primary master functionality.
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "check-wildcard", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKWILDCARD, check);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "check-dup-records", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRR, check);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRRFAIL, fail);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMX, check);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMXFAIL, fail);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "check-integrity", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKINTEGRITY,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "check-mx-cname", &obj);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNMXCNAME, warn);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNOREMXCNAME, ignore);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "check-srv-cname", &obj);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
af3459443207253f197cd684567bfea0311ab76dMark Andrews } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNSRVCNAME, warn);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNORESRVCNAME,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "dnssec-secure-to-insecure", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_SECURETOINSECURE,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = cfg_map_get(zoptions, "dnssec-update-mode", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "serial-update-method", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (strcasecmp(cfg_obj_asstring(obj), "unixtime") == 0)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Configure slave functionality.
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence RETERR(ns_config_getipandkeylist(config, obj, mctx,
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = dns_zone_setmasterswithkeys(mayberaw, addrs,
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = dns_zone_setmasters(mayberaw, NULL, 0);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "multi-master", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence dns_zone_setoption(mayberaw, DNS_ZONEOPT_MULTIMASTER, multi);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "max-transfer-time-in", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
402b05ddea16c6179fd251e4e740606dd973d593Bob Halley dns_zone_setmaxxfrin(mayberaw, cfg_obj_asuint32(obj) * 60);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "max-transfer-idle-in", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence dns_zone_setidlein(mayberaw, cfg_obj_asuint32(obj) * 60);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "max-refresh-time", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setmaxrefreshtime(mayberaw, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "min-refresh-time", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setminrefreshtime(mayberaw, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "max-retry-time", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setmaxretrytime(mayberaw, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "min-retry-time", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setminretrytime(mayberaw, cfg_obj_asuint32(obj));
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley result = ns_config_get(maps, "transfer-source", &obj);
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "transfer-source-v6", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "alt-transfer-source", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence result = ns_config_get(maps, "alt-transfer-source-v6", &obj);
213a9ec2addc5bcf3b168fe507312e7b25960e0bDavid Lawrence INSIST(result == ISC_R_SUCCESS && obj != NULL);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley (void)ns_config_get(maps, "use-alt-transfer-source", &obj);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Default off when views are in use otherwise
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * on for BIND 8 compatibility.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (view != NULL && strcmp(view->name, "_default") == 0)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_USEALTXFRSRC, alt);
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley (void)ns_config_get(maps, "try-tcp-refresh", &obj);
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley dns_zone_setoption(mayberaw, DNS_ZONEOPT_TRYTCPREFRESH,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley RETERR(configure_staticstub(zoptions, zone, zname,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Set up a DLZ zone as writeable
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyns_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley result = dns_sdlz_setdb(dlzdatabase, rdclass, name, &db);
cee7525336d4710a64368875d92eb439d4d3efb1Mark Andrewsns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley if (zonetype_fromconfig(zoptions) != dns_zone_gettype(zone))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * We always reconfigure a static-stub zone for simplicity, assuming
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * the amount of data to be loaded is small.
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley if (zonetype_fromconfig(zoptions) == dns_zone_staticstub)
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley if (!((cfilename == NULL && zfilename == NULL) ||
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley (void)cfg_map_get(zoptions, "inline-signing", &obj);
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley if ((obj == NULL || !cfg_obj_asboolean(obj)) && has_raw)
c5839c39bd07c9dd3d4cd598035deb0537098475Bob Halley if ((obj != NULL && cfg_obj_asboolean(obj)) && !has_raw)