summaryrefslogtreecommitdiffstats
path: root/src/sbus/sssd_dbus_private.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-05-09 20:03:02 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-05-13 21:46:46 +0200
commit0161a3c5637a0c0092bf54c436bb3d6508d7df26 (patch)
tree5d057559f2b8345608a422e1f544c446ba420b52 /src/sbus/sssd_dbus_private.h
parentb81ad4a7c59cade13d52216f805d904392627136 (diff)
downloadsssd-0161a3c5637a0c0092bf54c436bb3d6508d7df26.tar.gz
sssd-0161a3c5637a0c0092bf54c436bb3d6508d7df26.tar.xz
sssd-0161a3c5637a0c0092bf54c436bb3d6508d7df26.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>
Diffstat (limited to 'src/sbus/sssd_dbus_private.h')
-rw-r--r--src/sbus/sssd_dbus_private.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus_private.h b/src/sbus/sssd_dbus_private.h
index 58b385b71..65189b5ff 100644
--- a/src/sbus/sssd_dbus_private.h
+++ b/src/sbus/sssd_dbus_private.h
@@ -22,6 +22,8 @@
#ifndef _SSSD_DBUS_PRIVATE_H_
#define _SSSD_DBUS_PRIVATE_H_
+#include <dhash.h>
+
#include "sssd_dbus_meta.h"
union dbus_conn_pointer {
@@ -60,6 +62,7 @@ struct sbus_connection {
char *symlink;
sbus_server_conn_init_fn srv_init_fn;
void *srv_init_data;
+ hash_table_t *clients;
/* watches list */
struct sbus_watch_ctx *watch_list;
@@ -126,4 +129,12 @@ int sss_dbus_conn_send(DBusConnection *dbus_conn,
void *pvt,
DBusPendingCall **pending);
+
+/* =Retrieve-conn-credentials=============================================== */
+struct tevent_req *sbus_get_sender_id_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct sbus_connection *conn,
+ const char *sender);
+int sbus_get_sender_id_recv(struct tevent_req *req, int64_t *_uid);
+
#endif /* _SSSD_DBUS_PRIVATE_H_ */