summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-04-08 08:15:39 -0400
committerSimo Sorce <ssorce@redhat.com>2009-04-09 15:58:43 -0400
commit38222e7706f20fa90e6d79a0bb1c1e2800f1d622 (patch)
treeaac5d61a97dac6c8e4468013387fabbeb7586394
parent329651039032f044b4e1e13d0fc338e4d174b980 (diff)
downloadsssd-38222e7706f20fa90e6d79a0bb1c1e2800f1d622.tar.gz
sssd-38222e7706f20fa90e6d79a0bb1c1e2800f1d622.tar.bz2
sssd-38222e7706f20fa90e6d79a0bb1c1e2800f1d622.zip
Make the monitor address a compile-time option
Previously it was runtime-selectable in the confdb, but this is not a sensible approach, as if it were to change during runtime, it would cause problems communicating with the child services.
-rw-r--r--server/monitor/monitor.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 7fef0822..bc1b7c53 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -128,50 +128,40 @@ static int monitor_dbus_init(struct mt_ctx *ctx)
{
struct sbus_method_ctx *sd_ctx;
struct sbus_srv_ctx *sbus_srv;
- char *sbus_address;
- char *default_monitor_address;
+ char *monitor_address;
int ret;
- default_monitor_address = talloc_asprintf(ctx, "unix:path=%s/%s",
- PIPE_PATH, SSSD_SERVICE_PIPE);
- if (!default_monitor_address) {
+ sd_ctx = talloc_zero(ctx, struct sbus_method_ctx);
+ if (!sd_ctx) {
return ENOMEM;
}
- ret = confdb_get_string(ctx->cdb, ctx,
- MONITOR_CONF_ENTRY, "sbusAddress",
- default_monitor_address, &sbus_address);
- if (ret != EOK) {
- talloc_free(default_monitor_address);
- return ret;
- }
- talloc_free(default_monitor_address);
-
- sd_ctx = talloc_zero(ctx, struct sbus_method_ctx);
- if (!sd_ctx) {
- talloc_free(sbus_address);
+ monitor_address = talloc_asprintf(sd_ctx, "unix:path=%s/%s",
+ PIPE_PATH, SSSD_SERVICE_PIPE);
+ if (!monitor_address) {
+ talloc_free(sd_ctx);
return ENOMEM;
}
/* Set up globally-available D-BUS methods */
sd_ctx->interface = talloc_strdup(sd_ctx, MONITOR_DBUS_INTERFACE);
if (!sd_ctx->interface) {
- talloc_free(sbus_address);
talloc_free(sd_ctx);
return ENOMEM;
}
sd_ctx->path = talloc_strdup(sd_ctx, MONITOR_DBUS_PATH);
if (!sd_ctx->path) {
- talloc_free(sbus_address);
talloc_free(sd_ctx);
return ENOMEM;
}
sd_ctx->methods = monitor_methods;
sd_ctx->message_handler = sbus_message_handler;
- ret = sbus_new_server(ctx, ctx->ev, sd_ctx, &sbus_srv, sbus_address, dbus_service_init, ctx);
+ ret = sbus_new_server(ctx, ctx->ev, sd_ctx, &sbus_srv, monitor_address, dbus_service_init, ctx);
ctx->sbus_srv = sbus_srv;
+ talloc_free(monitor_address);
+
return ret;
}