summaryrefslogtreecommitdiffstats
path: root/server/providers
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@sgallagh.bos.redhat.com>2008-12-15 10:12:43 -0500
committerSimo Sorce <idra@samba.org>2008-12-15 15:40:25 -0500
commit124083f5801312aeef6f97402dba181d98eb708c (patch)
tree8158ed73911b2e9d4c047cffa2a0ea4205c38709 /server/providers
parenta5442a122917088afff240846700e858f45fe1de (diff)
downloadsssd-124083f5801312aeef6f97402dba181d98eb708c.tar.gz
sssd-124083f5801312aeef6f97402dba181d98eb708c.tar.xz
sssd-124083f5801312aeef6f97402dba181d98eb708c.zip
Disconnected client SBUS connections would delete the master set of sbus_method_ctx entries, meaning that the next connection to attempt to disconnect would receive a segmentation fault also trying to delete them. They are now talloc_reference()-ed to their connection context and talloc_unlink()-ed upon deletion.
I have also modified the sbus_new_server() call to take a reference to an sbus_srv_ctx object as a return argument, so that the calling function can keep track of the SBUS server context if it so chooses.
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/data_provider.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index 3bd0ef59d..150c6f6ae 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -49,6 +49,7 @@ struct dp_ctx {
struct confdb_ctx *cdb;
struct ldb_context *ldb;
struct service_sbus_ctx *ss_ctx;
+ struct sbus_srv_ctx *sbus_srv;
struct dp_backend *be_list;
struct dp_frontend *fe_list;
};
@@ -406,6 +407,7 @@ static int dp_frontend_destructor(void *ctx)
static int dp_srv_init(struct dp_ctx *dpctx)
{
TALLOC_CTX *tmp_ctx;
+ struct sbus_srv_ctx *sbus_srv;
struct sbus_method_ctx *sd_ctx;
char *dpbus_address;
char *default_dp_address;
@@ -449,11 +451,13 @@ 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, dpbus_address,
+ ret = sbus_new_server(dpctx->ev, sd_ctx,
+ &sbus_srv, dpbus_address,
dbus_dp_init, dpctx);
if (ret != EOK) {
goto done;
}
+ dpctx->sbus_srv = sbus_srv;
talloc_steal(dpctx, sd_ctx);
done: