|
|
9600a8 |
From 7dd6ba6c70273fef0ffd34b265e6f1a1b6988a26 Mon Sep 17 00:00:00 2001
|
|
|
9600a8 |
From: Petr Spacek <pspacek@redhat.com>
|
|
|
9600a8 |
Date: Fri, 7 Nov 2014 15:12:38 +0100
|
|
|
9600a8 |
Subject: [PATCH] Send DNS NOTIFY message after any modification to the zone.
|
|
|
9600a8 |
|
|
|
9600a8 |
https://fedorahosted.org/bind-dyndb-ldap/ticket/144
|
|
|
9600a8 |
---
|
|
|
9600a8 |
src/ldap_helper.c | 21 +++++++++++----------
|
|
|
9600a8 |
1 file changed, 11 insertions(+), 10 deletions(-)
|
|
|
9600a8 |
|
|
|
9600a8 |
diff --git a/src/ldap_helper.c b/src/ldap_helper.c
|
|
|
9600a8 |
index dac11396857aa69d67243b3bc275cf9714be2238..ddb787c152b522118357bb6dc5542dce6af8ee0e 100644
|
|
|
9600a8 |
--- a/src/ldap_helper.c
|
|
|
9600a8 |
+++ b/src/ldap_helper.c
|
|
|
9600a8 |
@@ -1017,7 +1017,7 @@ cleanup:
|
|
|
9600a8 |
* @warning Never call this on raw part of in-line secure zone.
|
|
|
9600a8 |
*/
|
|
|
9600a8 |
static isc_result_t ATTR_NONNULLS ATTR_CHECKRESULT
|
|
|
9600a8 |
-load_zone(dns_zone_t *zone) {
|
|
|
9600a8 |
+load_zone(dns_zone_t *zone, isc_boolean_t log) {
|
|
|
9600a8 |
isc_result_t result;
|
|
|
9600a8 |
isc_boolean_t zone_dynamic;
|
|
|
9600a8 |
isc_uint32_t serial;
|
|
|
9600a8 |
@@ -1036,15 +1036,18 @@ load_zone(dns_zone_t *zone) {
|
|
|
9600a8 |
}
|
|
|
9600a8 |
|
|
|
9600a8 |
CHECK(dns_zone_getserial2(raw, &serial));
|
|
|
9600a8 |
- dns_zone_log(raw, ISC_LOG_INFO, "loaded serial %u", serial);
|
|
|
9600a8 |
+ if (log == ISC_TRUE)
|
|
|
9600a8 |
+ dns_zone_log(raw, ISC_LOG_INFO, "loaded serial %u", serial);
|
|
|
9600a8 |
if (zone != NULL) {
|
|
|
9600a8 |
result = dns_zone_getserial2(zone, &serial);
|
|
|
9600a8 |
- if (result == ISC_R_SUCCESS)
|
|
|
9600a8 |
+ if (result == ISC_R_SUCCESS && log == ISC_TRUE)
|
|
|
9600a8 |
dns_zone_log(zone, ISC_LOG_INFO, "loaded serial %u",
|
|
|
9600a8 |
serial);
|
|
|
9600a8 |
/* in-line secure zone is loaded asynchonously in background */
|
|
|
9600a8 |
else if (result == DNS_R_NOTLOADED) {
|
|
|
9600a8 |
- dns_zone_log(zone, ISC_LOG_INFO, "signing in progress");
|
|
|
9600a8 |
+ if (log == ISC_TRUE)
|
|
|
9600a8 |
+ dns_zone_log(zone, ISC_LOG_INFO,
|
|
|
9600a8 |
+ "signing in progress");
|
|
|
9600a8 |
result = ISC_R_SUCCESS;
|
|
|
9600a8 |
} else
|
|
|
9600a8 |
goto cleanup;
|
|
|
9600a8 |
@@ -1154,7 +1157,7 @@ activate_zone(isc_task_t *task, ldap_instance_t *inst, dns_name_t *name) {
|
|
|
9600a8 |
goto cleanup;
|
|
|
9600a8 |
}
|
|
|
9600a8 |
|
|
|
9600a8 |
- CHECK(load_zone(toview));
|
|
|
9600a8 |
+ CHECK(load_zone(toview, ISC_TRUE));
|
|
|
9600a8 |
if (secure != NULL) {
|
|
|
9600a8 |
CHECK(zr_get_zone_settings(inst->zone_register, name,
|
|
|
9600a8 |
&zone_settings));
|
|
|
9600a8 |
@@ -2491,9 +2494,7 @@ ldap_parse_master_zoneentry(ldap_entry_t * const entry, dns_db_t * const olddb,
|
|
|
9600a8 |
if (isactive == ISC_TRUE) {
|
|
|
9600a8 |
if (new_zone == ISC_TRUE || activity_changed == ISC_TRUE)
|
|
|
9600a8 |
CHECK(publish_zone(task, inst, toview));
|
|
|
9600a8 |
- if (data_changed == ISC_TRUE || olddb != NULL ||
|
|
|
9600a8 |
- activity_changed == ISC_TRUE)
|
|
|
9600a8 |
- CHECK(load_zone(toview));
|
|
|
9600a8 |
+ CHECK(load_zone(toview, ISC_FALSE));
|
|
|
9600a8 |
} else if (activity_changed == ISC_TRUE) { /* Zone was deactivated */
|
|
|
9600a8 |
CHECK(unpublish_zone(inst, &name, entry->dn));
|
|
|
9600a8 |
dns_zone_log(toview, ISC_LOG_INFO, "zone deactivated "
|
|
|
9600a8 |
@@ -4668,9 +4669,9 @@ cleanup:
|
|
|
9600a8 |
"reload triggered by change in '%s'",
|
|
|
9600a8 |
pevent->dn);
|
|
|
9600a8 |
if (secure != NULL)
|
|
|
9600a8 |
- result = load_zone(secure);
|
|
|
9600a8 |
+ result = load_zone(secure, ISC_TRUE);
|
|
|
9600a8 |
else if (raw != NULL)
|
|
|
9600a8 |
- result = load_zone(raw);
|
|
|
9600a8 |
+ result = load_zone(raw, ISC_TRUE);
|
|
|
9600a8 |
if (result == ISC_R_SUCCESS || result == DNS_R_UPTODATE ||
|
|
|
9600a8 |
result == DNS_R_DYNAMIC || result == DNS_R_CONTINUE) {
|
|
|
9600a8 |
/* zone reload succeeded, fire current event again */
|
|
|
9600a8 |
--
|
|
|
9600a8 |
2.1.0
|
|
|
9600a8 |
|