From 953672109056601c29f3276d09dde830b6d5ca31 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 7 Sep 2012 05:00:59 +0200 Subject: [PATCH] Windows implementation of GetConnectionCredentials. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445 --- bus/driver.c | 15 +++++++++++++++ doc/dbus-specification.xml | 8 ++++++++ 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/bus/driver.c b/bus/driver.c index 23197e4..0c27ed5 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -38,6 +38,7 @@ #include #include #include +#include #include static DBusConnection * @@ -1535,6 +1536,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); @@ -1569,6 +1571,19 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, goto oom; } + if (dbus_connection_get_windows_user (conn, &windows_sid)) + { + if (_dbus_check_is_valid_utf8 (windows_sid)) + { + 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; diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index 07834cf..c511f1e 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -5653,6 +5653,14 @@ this concept. On Unix, this is the process ID defined by POSIX. + + WindowsSID + STRING + The Windows security identifier in its string form, + e.g. "S-1-5-21-3623811015-3361044348-30300820-1013" for + a domain or local computer user or "S-1-5-18" for the + LOCAL_SYSTEM user + -- 1.7.4.msysgit.0