summaryrefslogtreecommitdiffstats
path: root/src/sbus/sssd_dbus_connection.c
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-02-25 18:31:03 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-05-22 17:36:17 +0200
commit1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4 (patch)
treec507661a871ac03ca52c477a5a14bc570cfb18c1 /src/sbus/sssd_dbus_connection.c
parente412c809508be9cdd30da679b92ed9f7292357e9 (diff)
downloadsssd-1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4.tar.gz
sssd-1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4.tar.xz
sssd-1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4.zip
SBUS: Start implementing property access
This patch adds the basis of SBUS getters and setters. A new module, sssd_dbus_properties.c would contain handlers for the property methods like Get, Set and GetAll. Type-safe property access works in a similar fashion like type-safe method calls - the invoker calls the getter which returns the primitive type, which is in turn marshalled into variant by the invoker. This patch does not contain the complete functionality, see later patches that continue implementing the getters and setters. Reviewed-by: Stef Walter <stefw@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/sbus/sssd_dbus_connection.c')
-rw-r--r--src/sbus/sssd_dbus_connection.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sbus/sssd_dbus_connection.c b/src/sbus/sssd_dbus_connection.c
index 4d3782e56..af1c8c56a 100644
--- a/src/sbus/sssd_dbus_connection.c
+++ b/src/sbus/sssd_dbus_connection.c
@@ -437,6 +437,7 @@ DBusHandlerResult sbus_message_handler(DBusConnection *dbus_conn,
/* Validate the method interface */
if (strcmp(msg_interface, intf_p->intf->vtable->meta->name) == 0 ||
+ strcmp(msg_interface, DBUS_PROPERTIES_INTERFACE) == 0 ||
(strcmp(msg_interface, DBUS_INTROSPECT_INTERFACE) == 0 &&
strcmp(msg_method, DBUS_INTROSPECT_METHOD) == 0)) {
@@ -510,11 +511,7 @@ static void sbus_handler_got_caller_id(struct tevent_req *req)
dbus_error = DBUS_ERROR_NOT_SUPPORTED;
goto fail;
}
- } else {
- /* Special case: check for Introspection request
- * This is usually only useful for system bus connections
- */
- if (strcmp(msg_interface, DBUS_INTROSPECT_INTERFACE) == 0 &&
+ } else if (strcmp(msg_interface, DBUS_INTROSPECT_INTERFACE) == 0 &&
strcmp(msg_method, DBUS_INTROSPECT_METHOD) == 0) {
DEBUG(SSSDBG_TRACE_LIBS, "Got introspection request\n");
ictx = talloc(dbus_req->conn, struct sbus_introspect_ctx);
@@ -527,7 +524,17 @@ static void sbus_handler_got_caller_id(struct tevent_req *req)
ictx->iface = interface;
handler_data = ictx;
method = &introspect_method;
+ } else if (strcmp(msg_interface, DBUS_PROPERTIES_INTERFACE) == 0) {
+ ret = sbus_properties_dispatch(dbus_req);
+ if (ret == ERR_SBUS_NOSUP) {
+ /* No known method matched */
+ dbus_error = DBUS_ERROR_NOT_SUPPORTED;
+ goto fail;
}
+ /* sbus_properties_dispatch handles all other errors
+ * or success internally
+ */
+ return;
}
if (handler_fn == NULL) {