summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2009-05-27 15:15:46 +0200
committerSimo Sorce <ssorce@redhat.com>2009-05-28 15:41:04 -0400
commit553b185f1c765855fe5f5ce9b29533261f80fcba (patch)
treebfc480dd2f93669799c6165adaf59881bdf06728 /server
parentd5277520ea5b0133d94c6cbcc8ae4cdb1aad56a1 (diff)
downloadsssd-553b185f1c765855fe5f5ce9b29533261f80fcba.tar.gz
sssd-553b185f1c765855fe5f5ce9b29533261f80fcba.tar.xz
sssd-553b185f1c765855fe5f5ce9b29533261f80fcba.zip
Make Data Provider a mandatory service
Diffstat (limited to 'server')
-rw-r--r--server/monitor/monitor.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 26c600705..906d15798 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -581,6 +581,33 @@ static int check_domain_ranges(struct sss_domain_info *domains)
return EOK;
}
+static int append_data_provider(struct mt_ctx *ctx)
+{
+ int i;
+ char **new_services;
+
+ for (i = 0; ctx->services[i]; i++) {
+ if (strcasecmp(ctx->services[i], "dp") == 0) {
+ return EOK;
+ }
+ }
+
+ new_services = talloc_realloc(ctx, ctx->services, char *, i+2);
+ if (new_services == NULL) {
+ return ENOMEM;
+ }
+ ctx->services = new_services;
+
+ ctx->services[i] = talloc_asprintf(ctx, "dp");
+ if (ctx->services[i] == NULL) {
+ return ENOMEM;
+ }
+ ctx->services[i+1] = NULL;
+ DEBUG(4, ("Added mandatory service Data Provider\n"));
+
+ return EOK;
+}
+
int get_monitor_config(struct mt_ctx *ctx)
{
int ret;
@@ -598,6 +625,11 @@ int get_monitor_config(struct mt_ctx *ctx)
DEBUG(0, ("No services configured!\n"));
return EINVAL;
}
+ ret = append_data_provider(ctx);
+ if (ret != EOK) {
+ DEBUG(0, ("Could not add Data Provider to the list of services!\n"));
+ return ret;
+ }
ret = confdb_get_domains(ctx->cdb, ctx, &ctx->domains);
if (ret != EOK) {