From 7be5fd95cdccdca28937804f32ca8b1308887d09 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 9 Jun 2007 23:41:33 +0000 Subject: 2007-06-09 Havoc Pennington * bus/policy.c (bus_policy_create_client_policy): gracefully continue if the connection has no unix user - just don't apply any unix user dependent rules. * bus/config-parser.c: remove dbus-userdb.h usage * bus/bus.c: remove dbus-userdb.h usage * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated): support Windows user function; also, fix the logic for checking auth as root in the default auth code (broken in the previous commit) * dbus/dbus-connection.c (dbus_connection_set_windows_user_function): new function (dbus_connection_get_windows_user): new function --- dbus/dbus-connection.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'dbus/dbus-connection.h') diff --git a/dbus/dbus-connection.h b/dbus/dbus-connection.h index 819e96c8..2b673fda 100644 --- a/dbus/dbus-connection.h +++ b/dbus/dbus-connection.h @@ -132,14 +132,28 @@ typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection, * to do. Set with dbus_connection_set_wakeup_main_function(). */ typedef void (* DBusWakeupMainFunction) (void *data); + /** - * Called during authentication on UNIX systems to check whether the given - * user ID is allowed to connect. Never called on Windows. Set with + * Called during authentication to check whether the given UNIX user + * ID is allowed to connect, if the client tried to auth as a UNIX + * user ID. Normally on Windows this would never happen. Set with * dbus_connection_set_unix_user_function(). */ typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection, unsigned long uid, void *data); + +/** + * Called during authentication to check whether the given Windows user + * ID is allowed to connect, if the client tried to auth as a Windows + * user ID. Normally on UNIX this would never happen. Set with + * dbus_connection_set_windows_user_function(). + */ +typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection, + const char *user_sid, + void *data); + + /** * Called when a pending call now has a reply available. Set with * dbus_pending_call_set_notify(). @@ -219,6 +233,12 @@ void dbus_connection_set_unix_user_function (DBusConnection DBusAllowUnixUserFunction function, void *data, DBusFreeFunction free_data_function); +dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection, + char **windows_sid_p); +void dbus_connection_set_windows_user_function (DBusConnection *connection, + DBusAllowWindowsUserFunction function, + void *data, + DBusFreeFunction free_data_function); void dbus_connection_set_route_peer_messages (DBusConnection *connection, dbus_bool_t value); -- cgit