summaryrefslogtreecommitdiff
path: root/bus/driver.c
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2012-09-07 05:00:59 +0200
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-02-11 11:57:43 +0000
commitb417088ff7ef8c346181b279048bcd4b3da338a5 (patch)
tree6f3d45fb25f0ab88f5fee5e1b49a5f7df56e448e /bus/driver.c
parentc2e2c15455a8dac5f24da05bb7d5902259ca7af9 (diff)
Windows implementation of GetConnectionCredentials.
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445
Diffstat (limited to 'bus/driver.c')
-rw-r--r--bus/driver.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bus/driver.c b/bus/driver.c
index ceebb6f20..83040669c 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -38,6 +38,7 @@
#include <dbus/dbus-internals.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-marshal-recursive.h>
+#include <dbus/dbus-marshal-validate.h>
#include <string.h>
static DBusConnection *
@@ -1646,6 +1647,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
DBusMessageIter reply_iter;
DBusMessageIter array_iter;
unsigned long ulong_val;
+ char *windows_sid;
const char *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -1680,6 +1682,24 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
goto oom;
}
+ if (dbus_connection_get_windows_user (conn, &windows_sid))
+ {
+ DBusString str;
+ dbus_bool_t result;
+ _dbus_string_init_const (&str, windows_sid);
+ result = _dbus_validate_utf8 (&str, 0, _dbus_string_get_length (&str));
+ _dbus_string_free (&str);
+ if (result)
+ {
+ if (!_dbus_asv_add_string (&array_iter, "WindowsSID", windows_sid))
+ {
+ dbus_free(windows_sid);
+ goto oom;
+ }
+ }
+ dbus_free(windows_sid);
+ }
+
if (!_dbus_asv_close (&reply_iter, &array_iter))
goto oom;