From 3ec9f2e2d16cdae9db589fa9d9e2824661989377 Mon Sep 17 00:00:00 2001 From: drago01 Date: Wed, 18 Feb 2009 17:31:58 +0000 Subject: [PATCH] Add the ability to get the senders unix userid (Patch by Jiri Moskovcak) --- dbus-c++-get-uid-api.patch | 31 +++++++++++++++++++++++++++++++ dbus-c++.spec | 7 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 dbus-c++-get-uid-api.patch diff --git a/dbus-c++-get-uid-api.patch b/dbus-c++-get-uid-api.patch new file mode 100644 index 0000000..48afc2b --- /dev/null +++ b/dbus-c++-get-uid-api.patch @@ -0,0 +1,31 @@ +--- dbus-c++/include/dbus-c++/connection.h 2009-01-08 21:58:42.000000000 +0100 ++++ dbus-c++_mzk/include/dbus-c++/connection.h 2009-02-18 17:56:09.000000000 +0100 +@@ -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. +--- dbus-c++/src/connection.cpp 2009-01-08 21:58:42.000000000 +0100 ++++ dbus-c++_mzk/src/connection.cpp 2009-02-18 17:55:05.000000000 +0100 +@@ -398,6 +398,17 @@ void Connection::request_name(const char + } + } + ++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; diff --git a/dbus-c++.spec b/dbus-c++.spec index 60d3ecf..73b7292 100644 --- a/dbus-c++.spec +++ b/dbus-c++.spec @@ -2,7 +2,7 @@ %define git_version 13281b3 Name: dbus-c++ Version: 0.5.0 -Release: 0.4.%{git_date}git%{git_version}%{?dist} +Release: 0.5.%{git_date}git%{git_version}%{?dist} Summary: Native C++ bindings for D-Bus Group: System Environment/Libraries @@ -14,6 +14,8 @@ URL: http://freedesktop.org/wiki/Software/dbus-c++ Source0: %{name}-%{version}.%{git_date}git%{git_version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch1: dbus-c++-get-uid-api.patch + BuildRequires: dbus-devel BuildRequires: glib2-devel Buildrequires: gtkmm24-devel @@ -75,6 +77,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog +* Wed Feb 18 2009 Adel Gadllah - 0.5.0-0.5.20090203git13281b3 +- Add the ability to get the senders unix userid (Patch by Jiri Moskovcak) + * Tue Feb 03 2009 Adel Gadllah - 0.5.0-0.4.20090203git13281b3 - Update to new git snapshot - Should fix RH #483418