summaryrefslogtreecommitdiffstats
path: root/src/responder/ssh
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-02-18 14:32:54 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-06-02 19:03:26 +0200
commit5312bab5fa3a472111e0d6452ac326293adbfdbd (patch)
tree9c35700ff1e456391155b0aacfd6b27700983578 /src/responder/ssh
parent0a001b42869ebffdd6d82ca3a3fdbe31dc707035 (diff)
downloadsssd-5312bab5fa3a472111e0d6452ac326293adbfdbd.tar.gz
sssd-5312bab5fa3a472111e0d6452ac326293adbfdbd.tar.xz
sssd-5312bab5fa3a472111e0d6452ac326293adbfdbd.zip
sbus: Refactor how we export DBus interfaces
Most importantly, stop using per connection private data. This doesn't scale when you have more than one thing exporting or exported on a connection. Remove struct sbus_interface and expand sbus_conn_add_interface() function. Remove various struct sbus_interface args to connection initialization functions and make callers use sbus_conn_add_interface() directly. The old method was optimized for exporting one interface on a connection. We'll have connections that export zero, one or more interfaces. To export an interface on a DBus server, call sbus_conn_add_interface() from within the sbus_server_conn_init_fn. To export an interface on a DBus client, call sbus_conn_add_interface() after sbus_new_connection() returns. As before struct sbus_interface represents an object exported via DBus. However it is now talloc allocated. One can set instance data on the struct sbus_interface. This instance data is passed to the various handlers and used in their implementation. However, we now have type safe interface exporting in the various high level sss_process_init() sss_monitor_init() and so on. Introspection support was not in use, and is now gone until we implement it using the metadata (future patch). Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 07e941c1bbdc752142bbd3b838c540bc7ecd0ed7)
Diffstat (limited to 'src/responder/ssh')
-rw-r--r--src/responder/ssh/sshsrv.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
index fb0738f6c..30142ae0d 100644
--- a/src/responder/ssh/sshsrv.c
+++ b/src/responder/ssh/sshsrv.c
@@ -40,12 +40,6 @@ struct mon_cli_iface monitor_ssh_methods = {
.clearEnumCache = NULL,
};
-struct sbus_interface monitor_ssh_interface = {
- MONITOR_PATH,
- &monitor_ssh_methods.vtable,
- NULL
-};
-
static struct data_provider_iface ssh_dp_methods = {
{ &data_provider_iface_meta, 0 },
.RegisterService = NULL,
@@ -57,12 +51,6 @@ static struct data_provider_iface ssh_dp_methods = {
.getAccountInfo = NULL,
};
-struct sbus_interface ssh_dp_interface = {
- DP_PATH,
- &ssh_dp_methods.vtable,
- NULL
-};
-
static void ssh_dp_reconnect_init(struct sbus_connection *conn,
int status, void *pvt)
{
@@ -107,9 +95,9 @@ int ssh_process_init(TALLOC_CTX *mem_ctx,
CONFDB_SSH_CONF_ENTRY,
SSS_SSH_SBUS_SERVICE_NAME,
SSS_SSH_SBUS_SERVICE_VERSION,
- &monitor_ssh_interface,
+ &monitor_ssh_methods,
"SSH",
- &ssh_dp_interface,
+ &ssh_dp_methods.vtable,
&rctx);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n");