Hello,

this patch fixes crash on reload/halt. Current code will crash if no zones were loaded from LDAP (because of connection error or bad DN in config).


There is no BZ/ticket for this issue.

Petr^2 Spacek
>From 4f10354d7dcff6bff7421cc4594ec06da32da765 Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Fri, 23 Mar 2012 09:50:44 +0100
Subject: [PATCH] Fix crash on reload without any zones. Signed-off-by: Petr
 Spacek <pspa...@redhat.com>

---
 src/ldap_helper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ldap_helper.c b/src/ldap_helper.c
index 971d90f..e9ed7ca 100644
--- a/src/ldap_helper.c
+++ b/src/ldap_helper.c
@@ -504,9 +504,10 @@ destroy_ldap_instance(ldap_instance_t **ldap_instp)
 	rbt = zr_get_rbt(ldap_inst->zone_register);
 
 	result = dns_rbtnodechain_first(&chain, rbt, NULL, NULL);
-	RUNTIME_CHECK(result == ISC_R_SUCCESS || result == DNS_R_NEWORIGIN);
+	RUNTIME_CHECK(result == ISC_R_SUCCESS || result == DNS_R_NEWORIGIN
+			|| result == ISC_R_NOTFOUND);
 
-	while (result != ISC_R_NOMORE) {
+	while (result != ISC_R_NOMORE && result != ISC_R_NOTFOUND) {
 		dns_fixedname_t name;
 		dns_fixedname_init(&name);
 		result = dns_rbtnodechain_current(&chain, NULL,
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to