From 207f0a15bb486d8dc27cf5ff963fac6068ee2972 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 7 Oct 2004 02:15:14 +0000 Subject: [PATCH] 1705. [func] Allow the journal's name to be changed via named.conf. --- CHANGES | 2 +- bin/named/named.conf.docbook | 3 ++- bin/named/zoneconf.c | 7 ++++++- doc/arm/Bv9ARM-book.xml | 22 +++++++++++++++------- lib/bind9/check.c | 3 ++- lib/isccfg/namedconf.c | 3 ++- 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 4f7c30031a..d332035634 100644 --- a/CHANGES +++ b/CHANGES @@ -92,7 +92,7 @@ 1706. [bug] 'rndc stop' failed to cause zones to be flushed sometimes. [RT #12328] -1705. [placeholder] rt12327 +1705. [func] Allow the journal's name to be changed via named.conf. 1704. [port] lwres needed a snprintf() implementation for platforms without snprintf(). Add missing diff --git a/bin/named/named.conf.docbook b/bin/named/named.conf.docbook index 07d78507ec..ba4d6fa8c1 100644 --- a/bin/named/named.conf.docbook +++ b/bin/named/named.conf.docbook @@ -15,7 +15,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -444,6 +444,7 @@ zone string optional_class check-names ( fail | warn | ignore ); dialup dialuptype; ixfr-from-differences boolean; + journal quoted_string; allow-query { address_match_element; ... }; allow-transfer { address_match_element; ... }; diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 36a4ee84dd..cae30a3674 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.112 2004/04/20 14:11:46 marka Exp $ */ +/* $Id: zoneconf.c,v 1.113 2004/10/07 02:15:12 marka Exp $ */ #include @@ -393,6 +393,11 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig, filename = cfg_obj_asstring(obj); RETERR(dns_zone_setfile(zone, filename)); + obj = NULL; + result = cfg_map_get(zoptions, "journal", &obj); + if (result == ISC_R_SUCCESS) + RETERR(dns_zone_setjournal(zone, cfg_obj_asstring(obj))); + if (ztype == dns_zone_slave) RETERR(configure_zone_acl(zconfig, vconfig, config, "allow-notify", ac, zone, diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index 9a9a2aa3d5..34124cc5dd 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + BIND 9 Administrator Reference Manual @@ -1002,12 +1002,12 @@ protocol is specified in RFC 1996. The journal file - All changes made to a zone using dynamic update are stored in the - zone's journal file. This file is automatically created by the - server when when the first dynamic update takes place. The name of - the journal file is formed by appending the - extension .jnl to the - name of the corresponding zone file. The journal file is in a + All changes made to a zone using dynamic update are stored + in the zone's journal file. This file is automatically created + by the server when when the first dynamic update takes place. + The name of the journal file is formed by appending the extension + .jnl to the name of the corresponding zone + file unless specifically overridden. The journal file is in a binary format and should not be edited manually. The server will also occasionally write ("dump") @@ -4547,6 +4547,7 @@ Statement Grammar dialup dialup_option ; delegation-only yes_or_no ; file string ; + journal string ; forward (only|first) ; forwarders { ip_addr port ip_port ; ip_addr port ip_port ; ... }; ixfr-base string ; @@ -4706,6 +4707,13 @@ in the mid-1970s. Zone data for it can be specified with the CHAOS +journal +Allow the default journal's file name to be overridden. +The default is the zone's file with ".jnl" appended. +This is applicable to master and slave zones. + + + allow-notify See the description of allow-notify in diff --git a/lib/bind9/check.c b/lib/bind9/check.c index fe2c451211..d486e0176b 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check.c,v 1.48 2004/07/29 00:08:10 marka Exp $ */ +/* $Id: check.c,v 1.49 2004/10/07 02:15:13 marka Exp $ */ #include @@ -733,6 +733,7 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab, { "allow-update", MASTERZONE }, { "allow-update-forwarding", SLAVEZONE }, { "file", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE}, + { "journal", MASTERZONE | SLAVEZONE }, { "ixfr-base", MASTERZONE | SLAVEZONE }, { "ixfr-tmp-file", MASTERZONE | SLAVEZONE }, { "masters", SLAVEZONE | STUBZONE }, diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 391118d494..3ba8f66a09 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namedconf.c,v 1.36 2004/07/23 04:15:26 marka Exp $ */ +/* $Id: namedconf.c,v 1.37 2004/10/07 02:15:14 marka Exp $ */ #include @@ -793,6 +793,7 @@ zone_only_clauses[] = { { "type", &cfg_type_zonetype, 0 }, { "allow-update", &cfg_type_bracketed_aml, 0 }, { "file", &cfg_type_qstring, 0 }, + { "journal", &cfg_type_qstring, 0 }, { "ixfr-base", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, { "ixfr-tmp-file", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, { "masters", &cfg_type_namesockaddrkeylist, 0 },