From 94125e89b6be74cb20100d5321a98aa6529187a9 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 12 Jun 2007 18:36:19 +0000 Subject: 2007-06-12 Havoc Pennington * dbus/dbus-auth.c (sha1_handle_second_client_response) (handle_server_data_anonymous_mech): add the process ID from socket credentials, if available, even if not using EXTERNAL * dbus/dbus-transport.c (auth_via_default_rules): support allow_anonymous flag * dbus/dbus-connection.c (dbus_connection_get_is_anonymous) (dbus_connection_set_allow_anonymous): new API for controlling anonymous access --- dbus/dbus-credentials.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'dbus/dbus-credentials.c') diff --git a/dbus/dbus-credentials.c b/dbus/dbus-credentials.c index dde69281..2023c170 100644 --- a/dbus/dbus-credentials.c +++ b/dbus/dbus-credentials.c @@ -288,6 +288,20 @@ _dbus_credentials_are_empty (DBusCredentials *credentials) credentials->windows_sid == NULL; } +/** + * Checks whether a credentials object contains a user identity. + * + * @param credentials the object + * @returns #TRUE if there are no user identities in the object + */ +dbus_bool_t +_dbus_credentials_are_anonymous (DBusCredentials *credentials) +{ + return + credentials->unix_uid == DBUS_UID_UNSET && + credentials->windows_sid == NULL; +} + /** * Merge all credentials found in the second object into the first object, * overwriting the first object if there are any overlaps. -- cgit