summaryrefslogtreecommitdiffstats
path: root/src/zone_manager.c
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-08-03 10:24:46 +0200
committerMartin Nagy <mnagy@redhat.com>2009-08-04 16:50:54 +0200
commit146a55139f090dcdc5ee424679f729f4c3820b99 (patch)
tree6563129d23170683b0ed881627c65e37d8628b25 /src/zone_manager.c
parentfdd7b1de1f1a82ebfc8483fe5264717b502243a2 (diff)
downloadldap_driver-146a55139f090dcdc5ee424679f729f4c3820b99.tar.gz
ldap_driver-146a55139f090dcdc5ee424679f729f4c3820b99.tar.xz
ldap_driver-146a55139f090dcdc5ee424679f729f4c3820b99.zip
Gracefully fail if no zones are found in the initial lookup
If the initial search fails to find any zones, destroy the database instance, but return ISC_R_SUCCESS to BIND, since this is not technically a fault because of which BIND should abort. We do this because there is no point in refreshing zones if there are not any and it is not possible to add them later.
Diffstat (limited to 'src/zone_manager.c')
-rw-r--r--src/zone_manager.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zone_manager.c b/src/zone_manager.c
index ab9e740..d8a82a8 100644
--- a/src/zone_manager.c
+++ b/src/zone_manager.c
@@ -147,7 +147,14 @@ manager_create_db_instance(isc_mem_t *mctx, const char *name,
CHECK(new_ldap_instance(mctx, db_inst->name, argv, dyndb_args, &db_inst->ldap_inst));
CHECK(new_ldap_cache(mctx, argv, &db_inst->ldap_cache));
- refresh_zones_from_ldap(db_inst->ldap_inst, ISC_TRUE);
+ result = refresh_zones_from_ldap(db_inst->ldap_inst, ISC_TRUE);
+ if (result != ISC_R_SUCCESS) {
+ /* In case we don't find any zones, we at least return
+ * ISC_R_SUCCESS so BIND won't exit because of this. */
+ result = ISC_R_SUCCESS;
+ log_error("no valid zones found");
+ goto cleanup;
+ }
/* Add a timer to periodically refresh the zones. */
if (zone_refresh) {