From c5651f39ef1660150ffdaed6f35ea14708327adc Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 9 May 2014 20:03:02 +0200 Subject: SBUS: Add an async request to retrieve the caller ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Stef Walter (cherry picked from commit 0161a3c5637a0c0092bf54c436bb3d6508d7df26) Conflicts: Makefile.am --- Makefile.am | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 0dfd6003d..65595aa06 100644 --- a/Makefile.am +++ b/Makefile.am @@ -163,6 +163,7 @@ if HAVE_CMOCKA ad_common_tests \ dp_opt_tests \ responder-get-domains-tests \ + sbus-internal-tests \ test_search_bases endif @@ -1411,6 +1412,27 @@ responder_get_domains_tests_LDADD = \ $(SSSD_INTERNAL_LTLIBS) \ libsss_test_common.la +sbus_internal_tests_SOURCES = \ + src/tests/cmocka/sbus_internal_tests.c \ + src/sbus/sssd_dbus_request.c +sbus_internal_tests_CFLAGS = \ + $(AM_CFLAGS) +sbus_internal_tests_LDFLAGS = \ + -Wl,-wrap,dbus_bus_get \ + -Wl,-wrap,dbus_pending_call_steal_reply \ + -Wl,-wrap,dbus_pending_call_unref \ + -Wl,-wrap,dbus_message_unref \ + -Wl,-wrap,dbus_connection_unref \ + -Wl,-wrap,dbus_connection_set_exit_on_disconnect \ + -Wl,-wrap,hash_lookup +sbus_internal_tests_LDADD = \ + $(CMOCKA_LIBS) \ + $(SSSD_LIBS) \ + libsss_util.la \ + libsss_crypt.la \ + libsss_debug.la \ + libsss_test_common.la + test_find_uid_DEPENDENCIES = \ $(ldblib_LTLIBRARIES) test_find_uid_SOURCES = \ -- cgit