* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: update.c,v 1.99 2002/05/24 06:26:04 marka Exp $ */
+/* $Id: update.c,v 1.100 2002/06/12 06:29:43 marka Exp $ */
#include <config.h>
namebuf, classbuf, message);
}
+static isc_result_t
+checkupdateacl(ns_client_t *client, dns_acl_t *acl, const char *message,
+ dns_name_t *zonename)
+{
+ char namebuf[DNS_NAME_FORMATSIZE];
+ char classbuf[DNS_RDATACLASS_FORMATSIZE];
+ int level = ISC_LOG_ERROR;
+ const char *msg = "denied";
+ isc_result_t result;
+
+ result = ns_client_checkaclsilent(client, acl, ISC_FALSE);
+
+ if (result == ISC_R_SUCCESS) {
+ level = ISC_LOG_DEBUG(3);
+ msg = "approved";
+ }
+
+ dns_name_format(zonename, namebuf, sizeof(namebuf));
+ dns_rdataclass_format(client->view->rdclass, classbuf,
+ sizeof(classbuf));
+
+ ns_client_log(client, NS_LOGCATEGORY_UPDATE_SECURITY,
+ NS_LOGMODULE_UPDATE, level, "%s '%s/%s' %s",
+ message, namebuf, classbuf, msg);
+ return (result);
+}
+
/*
* Update a single RR in version 'ver' of 'db' and log the
* update in 'diff'.
CHECK(send_update_event(client, zone));
break;
case dns_zone_slave:
- CHECK(ns_client_checkacl(client, "update forwarding",
- dns_zone_getforwardacl(zone),
- ISC_FALSE, ISC_LOG_ERROR));
+ CHECK(checkupdateacl(client, dns_zone_getforwardacl(zone),
+ "update forwarding", zonename));
CHECK(send_forward_event(client, zone));
break;
default:
* Check Requestor's Permissions. It seems a bit silly to do this
* only after prerequisite testing, but that is what RFC2136 says.
*/
+ result = ISC_R_SUCCESS;
+ if (ssutable == NULL)
+ CHECK(checkupdateacl(client, dns_zone_getupdateacl(zone),
+ "update", zonename));
+ else if (client->signer == NULL)
+ CHECK(checkupdateacl(client, NULL, "update", zonename));
+
if (dns_zone_getupdatedisabled(zone))
FAILC(DNS_R_REFUSED, "dynamic update temporarily disabled");
- if (ssutable == NULL) {
- char msg[DNS_RDATACLASS_FORMATSIZE + DNS_NAME_FORMATSIZE
- + sizeof("update '/'")];
- ns_client_aclmsg("update", zonename, client->view->rdclass,
- msg, sizeof(msg));
- CHECK(ns_client_checkacl(client, msg,
- dns_zone_getupdateacl(zone),
- ISC_FALSE, ISC_LOG_ERROR));
- } else if (client->signer == NULL) {
- /* This gets us a free log message. */
- char msg[DNS_RDATACLASS_FORMATSIZE + DNS_NAME_FORMATSIZE
- + sizeof("update '/'")];
- ns_client_aclmsg("update", zonename, client->view->rdclass,
- msg, sizeof(msg));
- CHECK(ns_client_checkacl(client, msg, NULL, ISC_FALSE,
- ISC_LOG_ERROR));
- }
/*
* Perform the Update Section Prescan.
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
-<!-- File: $Id: Bv9ARM-book.xml,v 1.200 2002/05/17 02:07:36 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.201 2002/06/12 06:29:49 marka Exp $ -->
<book>
<title>BIND 9 Administrator Reference Manual</title>
<entry colname = "2"><para>Dynamic updates.</para></entry>
</row>
<row rowsep = "0">
+<entry colname = "1"><para><command>update-security</command></para></entry>
+<entry colname = "2"><para>Approval and denial of update requests.</para></entry>
+</row>
+<row rowsep = "0">
<entry colname = "1"><para><command>queries</command></para></entry>
<entry colname = "2"><para>Queries. Using the category <command>queries</command> will enable query logging.</para></entry>
</row>
<optional> dialup <replaceable>dialup_option</replaceable>; </optional>
<optional> fake-iquery <replaceable>yes_or_no</replaceable>; </optional>
<optional> fetch-glue <replaceable>yes_or_no</replaceable>; </optional>
+ <optional> flush-zones-on-shutdown <replaceable>yes_or_no</replaceable>; </optional>
<optional> has-old-clients <replaceable>yes_or_no</replaceable>; </optional>
<optional> host-statistics <replaceable>yes_or_no</replaceable>; </optional>
<optional> minimal-responses <replaceable>yes_or_no</replaceable>; </optional>
data section of a response. This is now considered a bad idea
and BIND 9 never does it.</para></listitem></varlistentry>
+<varlistentry><term><command>flush-zones-on-shutdown</command></term>
+<listitem><para>When the nameserver exits due receiving SIGTERM,
+flush / do not flush any pending zone writes. The default is
+<command>flush-zones-on-shutdown</command> <userinput>no</userinput>.
+</para></listitem></varlistentry>
+
<varlistentry><term><command>has-old-clients</command></term>
<listitem><para>This option was incorrectly implemented
in <acronym>BIND</acronym> 8, and is ignored by <acronym>BIND</acronym> 9.