summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Volz <andreas@frodo.mittelerde>2009-02-22 18:08:31 +0100
committerAndreas Volz <andreas@frodo.mittelerde>2009-02-22 18:08:31 +0100
commiteefe20a40da700d5e29f5925262609cbcce68175 (patch)
treece69467e34d1bd9e46bc5f23d8d2513ae84429c5
parent89ea273d114113201c77edaee2e8fcbcad43663f (diff)
downloaddbus-c++-eefe20a40da700d5e29f5925262609cbcce68175.tar.gz
contributed by Jiri Moskovcak <jmoskovc@redhat.com>
-rw-r--r--include/dbus-c++/connection.h2
-rw-r--r--src/connection.cpp11
2 files changed, 13 insertions, 0 deletions
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;