summaryrefslogtreecommitdiff
path: root/server/monitor/monitor.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-02-27 13:35:33 -0500
committerSimo Sorce <ssorce@redhat.com>2009-02-27 17:11:23 -0500
commit24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8 (patch)
tree735441471a4e8c5fcc2dd9b9311b000f44584e29 /server/monitor/monitor.c
parent60bbc5034e546b7df7a6f782e3353b863f49618b (diff)
downloadsssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.tar.gz
sssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.tar.bz2
sssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.zip
Refactor creation of domain_map into confdb
The NSS provider, the Data Provider backends and the InfoPipe all need access to the domain map provided by the confdb. Instead of reimplimenting it in multiple places, it is now provided in a pair of helper functions from the confdb. confdb_get_domains() returns a domain map by reference. Always returns the most up-to-date set of domains from the confdb. confdb_get_domains_list() returns an array of strings of all the domain names. Always returns the most up-to-date set of domains from the confdb. This patch also modifies the btreemap_get_keys() function to better handle memory and report allocation failures.
Diffstat (limited to 'server/monitor/monitor.c')
-rw-r--r--server/monitor/monitor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index ff88b293..a07178f8 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -365,6 +365,7 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
struct mt_ctx *ctx;
struct mt_svc *svc;
char **doms;
+ int dom_count;
char *path;
int ret, i;
@@ -434,13 +435,13 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
}
/* now start the data providers */
- ret = confdb_get_domains(cdb, ctx, &doms);
+ ret = confdb_get_domains_list(cdb, ctx, (const char ***)&doms, &dom_count);
if (ret != EOK) {
DEBUG(2, ("No domains configured. LOCAL should always exist!\n"));
return ret;
}
- for (i = 0; doms[i]; i++) {
+ for (i = 0; i < dom_count; i++) {
svc = talloc_zero(ctx, struct mt_svc);
if (!svc) {
talloc_free(ctx);