From a26607ab68bf0878f23d2dbddec781b4b760d034 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 23 Mar 2003 07:41:54 +0000 Subject: 2003-03-23 Havoc Pennington * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny policies code * dbus/dbus-hash.h: add ULONG hash keys * dbus/dbus-sysdeps.c (_dbus_get_groups): new (_dbus_get_group_id): new function --- dbus/dbus-connection.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'dbus/dbus-connection.c') diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index db621405..ad8a1724 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -2214,6 +2214,8 @@ dbus_connection_handle_watch (DBusConnection *connection, * Gets the UNIX user ID of the connection if any. * Returns #TRUE if the uid is filled in. * Always returns #FALSE on non-UNIX platforms. + * Always returns #FALSE prior to authenticating the + * connection. * * @param connection the connection * @param uid return location for the user ID @@ -2226,8 +2228,12 @@ dbus_connection_get_unix_user (DBusConnection *connection, dbus_bool_t result; dbus_mutex_lock (connection->mutex); - result = _dbus_transport_get_unix_user (connection->transport, - uid); + + if (!_dbus_transport_get_is_authenticated (connection->transport)) + result = FALSE; + else + result = _dbus_transport_get_unix_user (connection->transport, + uid); dbus_mutex_unlock (connection->mutex); return result; -- cgit