summaryrefslogtreecommitdiffstats
path: root/src/sbus/sssd_dbus_connection.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-05-09 20:03:02 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-06-03 13:31:22 +0200
commitc5651f39ef1660150ffdaed6f35ea14708327adc (patch)
tree6f2802cab5917b4596660721e2b161affcb7253e /src/sbus/sssd_dbus_connection.c
parent40074db97ed4552cf09b1b6d71c19f53d010f80b (diff)
downloadsssd-c5651f39ef1660150ffdaed6f35ea14708327adc.tar.gz
sssd-c5651f39ef1660150ffdaed6f35ea14708327adc.tar.xz
sssd-c5651f39ef1660150ffdaed6f35ea14708327adc.zip
SBUS: Add an async request to retrieve the caller ID
Adds an async request sbus_get_sender_id_{send,recv} that allows retrieval of UID based on "sender" as returned by dbus_message_get_sender(). The UID is an int64_t to be able to use "-1" to as a fallback value for uknown or error cases. The unit test is added as a standalone one, not part of the sbus_tests because the request, and by extension the unit test relies on being connected to the system bus, which is very unlikely to work in a build system. Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Stef Walter <stefw@redhat.com> (cherry picked from commit 0161a3c5637a0c0092bf54c436bb3d6508d7df26) Conflicts: Makefile.am
Diffstat (limited to 'src/sbus/sssd_dbus_connection.c')
-rw-r--r--src/sbus/sssd_dbus_connection.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus_connection.c b/src/sbus/sssd_dbus_connection.c
index 33d5b1a38..b42020bc2 100644
--- a/src/sbus/sssd_dbus_connection.c
+++ b/src/sbus/sssd_dbus_connection.c
@@ -173,6 +173,13 @@ int sbus_init_connection(TALLOC_CTX *ctx,
conn->dbus.conn = dbus_conn;
conn->connection_type = connection_type;
+ ret = sss_hash_create(conn, 32, &conn->clients);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot create clients hash table\n");
+ talloc_free(conn);
+ return EIO;
+ }
+
ret = sbus_conn_set_fns(conn);
if (ret != EOK) {
talloc_free(conn);