summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2008-12-15 15:54:08 -0500
committerSimo Sorce <idra@samba.org>2008-12-15 15:56:16 -0500
commit4e2a152169175b18f5fac45b25a8d8c8a5bea2b5 (patch)
treeb3064bf9789e11eeb69cdbb806e4279fc3e60c51 /server
parent519a8e9cba9df29a396d6509fb71a10ef1aacec0 (diff)
downloadsssd-4e2a152169175b18f5fac45b25a8d8c8a5bea2b5.tar.gz
sssd-4e2a152169175b18f5fac45b25a8d8c8a5bea2b5.tar.bz2
sssd-4e2a152169175b18f5fac45b25a8d8c8a5bea2b5.zip
Modified sbus_server_new() to take a talloc memory context to use
as a parent for the new server context object.
Diffstat (limited to 'server')
-rw-r--r--server/monitor.c2
-rw-r--r--server/providers/data_provider.c3
-rw-r--r--server/sbus/sssd_dbus.h3
-rw-r--r--server/sbus/sssd_dbus_server.c5
4 files changed, 8 insertions, 5 deletions
diff --git a/server/monitor.c b/server/monitor.c
index 73f993ed..c6940a83 100644
--- a/server/monitor.c
+++ b/server/monitor.c
@@ -157,7 +157,7 @@ static int monitor_dbus_init(struct mt_ctx *ctx)
sd_ctx->methods = monitor_methods;
sd_ctx->message_handler = sbus_message_handler;
- ret = sbus_new_server(ctx->ev, sd_ctx, &sbus_srv, sbus_address, dbus_service_init, ctx);
+ ret = sbus_new_server(ctx, ctx->ev, sd_ctx, &sbus_srv, sbus_address, dbus_service_init, ctx);
ctx->sbus_srv = sbus_srv;
return ret;
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index 40012808..cc63b045 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -451,7 +451,8 @@ static int dp_srv_init(struct dp_ctx *dpctx)
sd_ctx->methods = dp_sbus_methods;
sd_ctx->message_handler = sbus_message_handler;
- ret = sbus_new_server(dpctx->ev, sd_ctx,
+ ret = sbus_new_server(dpctx,
+ dpctx->ev, sd_ctx,
&sbus_srv, dpbus_address,
dbus_dp_init, dpctx);
if (ret != EOK) {
diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h
index 39846994..cf59a22f 100644
--- a/server/sbus/sssd_dbus.h
+++ b/server/sbus/sssd_dbus.h
@@ -67,7 +67,8 @@ struct sbus_message_handler_ctx {
};
/* Server Functions */
-int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx,
+int sbus_new_server(TALLOC_CTX *mem_ctx,
+ struct event_context *ev, struct sbus_method_ctx *ctx,
struct sbus_srv_ctx **server_ctx, const char *address,
sbus_server_conn_init_fn init_fn, void *init_pvt_data);
diff --git a/server/sbus/sssd_dbus_server.c b/server/sbus/sssd_dbus_server.c
index d1d93739..4f38345c 100644
--- a/server/sbus/sssd_dbus_server.c
+++ b/server/sbus/sssd_dbus_server.c
@@ -253,7 +253,8 @@ static void sbus_server_init_new_connection(DBusServer *server,
* Set up a D-BUS server, integrate with the event loop
* for handling file descriptor and timed events
*/
-int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx,
+int sbus_new_server(TALLOC_CTX *mem_ctx,
+ struct event_context *ev, struct sbus_method_ctx *ctx,
struct sbus_srv_ctx **server_ctx, const char *address,
sbus_server_conn_init_fn init_fn, void *init_pvt_data)
{
@@ -278,7 +279,7 @@ int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx,
DEBUG(3, ("D-BUS Server listening on %s\n", tmp));
free(tmp);
- srv_ctx = talloc_zero(ev, struct sbus_srv_ctx);
+ srv_ctx = talloc_zero(mem_ctx, struct sbus_srv_ctx);
if (!srv_ctx) {
return ENOMEM;
}