diff options
author | Stephen Gallagher <sgallagh@sgallagh.bos.redhat.com> | 2008-12-15 10:12:43 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-15 15:40:25 -0500 |
commit | 124083f5801312aeef6f97402dba181d98eb708c (patch) | |
tree | 8158ed73911b2e9d4c047cffa2a0ea4205c38709 /server/sbus/sssd_dbus_server.c | |
parent | a5442a122917088afff240846700e858f45fe1de (diff) | |
download | sssd-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/sbus/sssd_dbus_server.c')
-rw-r--r-- | server/sbus/sssd_dbus_server.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/sbus/sssd_dbus_server.c b/server/sbus/sssd_dbus_server.c index 182e31010..d1d937393 100644 --- a/server/sbus/sssd_dbus_server.c +++ b/server/sbus/sssd_dbus_server.c @@ -254,8 +254,8 @@ static void sbus_server_init_new_connection(DBusServer *server, * for handling file descriptor and timed events */ int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, - const char *address, sbus_server_conn_init_fn init_fn, - void *init_pvt_data) + struct sbus_srv_ctx **server_ctx, const char *address, + sbus_server_conn_init_fn init_fn, void *init_pvt_data) { struct sbus_srv_ctx *srv_ctx; DBusServer *dbus_server; @@ -263,6 +263,8 @@ int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, dbus_bool_t dbret; char *tmp; + *server_ctx = NULL; + /* Set up D-BUS server */ dbus_error_init(&dbus_error); dbus_server = dbus_server_listen(address, &dbus_error); @@ -320,6 +322,7 @@ int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, return EIO; } + *server_ctx = srv_ctx; return EOK; } |