summaryrefslogtreecommitdiff
path: root/server/monitor
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-02-28 02:22:11 -0500
committerSimo Sorce <ssorce@redhat.com>2009-02-28 02:31:34 -0500
commitfcecd2ae67c315a900c374dec2cad3401b3f8bb5 (patch)
tree6568f0c7031c197e7312c884c738f12f593873cb /server/monitor
parent24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8 (diff)
downloadsssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.tar.gz
sssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.tar.bz2
sssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.zip
Fix confdb issues.
Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead.
Diffstat (limited to 'server/monitor')
-rw-r--r--server/monitor/monitor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index a07178f8..fb5b9b91 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -63,6 +63,7 @@ struct mt_svc {
struct mt_ctx {
struct tevent_context *ev;
struct confdb_ctx *cdb;
+ struct btreemap *dom_map;
char **services;
struct mt_svc *svc_list;
struct sbus_srv_ctx *sbus_srv;
@@ -364,7 +365,7 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
{
struct mt_ctx *ctx;
struct mt_svc *svc;
- char **doms;
+ const char **doms;
int dom_count;
char *path;
int ret, i;
@@ -435,7 +436,8 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
}
/* now start the data providers */
- ret = confdb_get_domains_list(cdb, ctx, (const char ***)&doms, &dom_count);
+ ret = confdb_get_domains_list(cdb, ctx,
+ &(ctx->dom_map), &doms, &dom_count);
if (ret != EOK) {
DEBUG(2, ("No domains configured. LOCAL should always exist!\n"));
return ret;