From 0161a3c5637a0c0092bf54c436bb3d6508d7df26 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 --- src/util/util_errors.c | 2 ++ src/util/util_errors.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/util') diff --git a/src/util/util_errors.c b/src/util/util_errors.c index d27d20b0a..90faa3e42 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -56,6 +56,8 @@ struct err_string error_to_str[] = { { "No POSIX attributes detected" }, /* ERR_NO_POSIX */ { "Extra attribute is a duplicate" }, /* ERR_DUP_EXTRA_ATTR */ { "Malformed extra attribute" }, /* ERR_INVALID_EXTRA_ATTR */ + { "Cannot get bus message sender" }, /* ERR_SBUS_GET_SENDER_ERROR */ + { "Bus message has no sender" }, /* ERR_SBUS_NO_SENDER */ }; diff --git a/src/util/util_errors.h b/src/util/util_errors.h index f03fc16b1..4d9f16c0a 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -78,6 +78,8 @@ enum sssd_errors { ERR_NO_POSIX, ERR_DUP_EXTRA_ATTR, ERR_INVALID_EXTRA_ATTR, + ERR_SBUS_GET_SENDER_ERROR, + ERR_SBUS_NO_SENDER, ERR_LAST /* ALWAYS LAST */ }; -- cgit