From 34d6a2e980cadaf79c327665254a1f48f417e302 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Mon, 8 Jun 2009 10:07:04 -0400
Subject: [PATCH] Treat a missing provider entry as a config error

---
 server/confdb/confdb.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 7c88b25..8eefcfb 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -730,6 +730,11 @@ int confdb_get_domain(struct confdb_ctx *cdb,
             goto done;
         }
     }
+    else {
+        DEBUG(0, ("Domain [%s] does not specify a provider, disabling!\n",
+                  domain->name));
+        ret = EINVAL;
+    }
 
     domain->timeout = ldb_msg_find_attr_as_int(res->msgs[0],
                                                "timeout", 0);
@@ -805,8 +810,8 @@ int confdb_get_domains(struct confdb_ctx *cdb,
     for (i = 0; domlist[i]; i++) {
         ret = confdb_get_domain(cdb, mem_ctx, domlist[i], &domain);
         if (ret) {
-            DEBUG(0, ("Error (%d [%s]) retrieving domain %s, skipping!\n",
-                      ret, strerror(ret), domains[i]));
+            DEBUG(0, ("Error (%d [%s]) retrieving domain [%s], skipping!\n",
+                      ret, strerror(ret), domlist[i]));
             continue;
         }
 
-- 
1.6.2.2

