Blob Blame History Raw
From d3057f37d4dc163af58b63424a835f95fa74141d Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@redhat.com>
Date: Wed, 15 Dec 2010 17:49:15 +0100
Subject: [PATCH 4/4] [Bugfix] Fix loading of child zones from LDAP.

This commit fixes https://bugzilla.redhat.com/show_bug.cgi?id=622617.

Signed-off-by: Adam Tkac <atkac@redhat.com>
---
 src/zone_register.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/zone_register.c b/src/zone_register.c
index 7fb9924..ca51875 100644
--- a/src/zone_register.c
+++ b/src/zone_register.c
@@ -180,9 +180,12 @@ zr_add_zone(zone_register_t *zr, dns_zone_t *zone, const char *dn)
 
 	RWLOCK(&zr->rwlock, isc_rwlocktype_write);
 
-	/* First make sure the node doesn't exist. */
+	/*
+	 * First make sure the node doesn't exist. Partial matches mean
+	 * there are also child zones in the LDAP database which is allowed.
+	 */
 	result = dns_rbt_findname(zr->rbt, name, 0, NULL, &dummy);
-	if (result != ISC_R_NOTFOUND) {
+	if (result != ISC_R_NOTFOUND && result != DNS_R_PARTIALMATCH) {
 		if (result == ISC_R_SUCCESS)
 			result = ISC_R_EXISTS;
 		log_error_r("failed to add zone to the zone register");
-- 
1.7.3.3