From eefe20a40da700d5e29f5925262609cbcce68175 Mon Sep 17 00:00:00 2001 From: Andreas Volz Date: Sun, 22 Feb 2009 18:08:31 +0100 Subject: [PATCH] contributed by Jiri Moskovcak --- include/dbus-c++/connection.h | 2 ++ src/connection.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/dbus-c++/connection.h b/include/dbus-c++/connection.h index 5cf1ae0..410ce55 100644 --- a/include/dbus-c++/connection.h +++ b/include/dbus-c++/connection.h @@ -409,6 +409,8 @@ public: PendingCall send_async( Message& msg, int timeout = -1); void request_name( const char* name, int flags = 0 ); + + unsigned long sender_unix_uid(const char *sender); /*! * \brief Asks the bus whether a certain name has an owner. diff --git a/src/connection.cpp b/src/connection.cpp index 4244d9a..9fb85a1 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -398,6 +398,17 @@ void Connection::request_name(const char *name, int flags) } } +unsigned long Connection::sender_unix_uid(const char *sender) +{ + InternalError e; + + unsigned long ul = dbus_bus_get_unix_user(_pvt->conn, sender, e); + + if (e) throw Error(e); + + return ul; +} + bool Connection::has_name(const char *name) { InternalError e;