From 8aad83614076166b3eadd915a41d0bdcd1c7e16e Mon Sep 17 00:00:00 2001 From: Cosimo Alfarano Date: Fri, 7 Oct 2011 14:53:10 +0100 Subject: [PATCH 6/8] Remove transport's call to _dbus_authorization_do_authorization() All mechs do authorization before answering OK/REJECT. There is no reason to run a second round of authorization which will return the same answer of the first time (when OK) or will never be reched (if REJECTed). --- dbus/dbus-transport.c | 23 ----------------------- 1 files changed, 0 insertions(+), 23 deletions(-) diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index 78b072a..cc21786 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -570,9 +570,6 @@ _dbus_transport_get_is_authenticated (DBusTransport *transport) if (transport->disconnected) return FALSE; - /* paranoia ref since we call user callbacks sometimes */ - _dbus_connection_ref_unlocked (transport->connection); - maybe_authenticated = (!(transport->send_credentials_pending || transport->receive_credentials_pending)); @@ -609,28 +606,8 @@ _dbus_transport_get_is_authenticated (DBusTransport *transport) } } - /* If we're the server, see if we want to allow this identity to proceed. - */ - if (maybe_authenticated && transport->is_server) - { - DBusCredentials *auth_identity; - - auth_identity = _dbus_auth_get_identity (transport->auth); - _dbus_assert (auth_identity != NULL); - - /* If we have an authenticated user, delegate deciding whether auth - * credentials are good enough to the app */ - if (!_dbus_authorization_do_authorization (transport->authorization, - auth_identity)) - { - _dbus_transport_disconnect (transport); - maybe_authenticated = FALSE; - } - } - transport->authenticated = maybe_authenticated; - _dbus_connection_unref_unlocked (transport->connection); return maybe_authenticated; } } -- 1.7.6.3