Hello,

this patch prevents potential failure during invalid zone unload. Error handling was changed to the same way as in bind/bin/named/server.c ns_server_del_zone().


Petr^2 Spacek
From 02e232632a8a04fcd17f1089553961c18c0b175a Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Wed, 25 Jul 2012 10:07:20 +0200
Subject: [PATCH] Handle incomplete/invalid zone unload in same way as
 ns_server_del_zone().

Signed-off-by: Petr Spacek <pspa...@redhat.com>
---
 src/ldap_helper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ldap_helper.c b/src/ldap_helper.c
index daffac7c7825a99a07c333217638d3beaddfaad2..cc7003a6cdcd2d27404fec936623ed8a3e8fa7f8 100644
--- a/src/ldap_helper.c
+++ b/src/ldap_helper.c
@@ -823,7 +823,7 @@ ldap_delete_zone2(ldap_instance_t *inst, dns_name_t *name, isc_boolean_t lock)
 
 	/* Do not unload partially loaded zones, they have incomplete structures. */
 	dns_db_t *dbp = NULL;
-	if (dns_zone_getdb(zone, &dbp) != DNS_R_NOTLOADED) {
+	if (dns_zone_getdb(zone, &dbp) == ISC_R_SUCCESS) {
 		dns_db_detach(&dbp); /* dns_zone_getdb() attaches DB implicitly */
 		dns_zone_unload(zone);
 	}
-- 
1.7.10.4

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

Reply via email to