summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-transport.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-14 02:29:21 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-14 02:29:21 +0000
commit777707ed8dff6958972a93894a87ec1945c65c14 (patch)
tree4ade9d56eccc5280150968e692a389e8749ed029 /dbus/dbus-transport.c
parent8aabca8dd28a113712389be51e75ea8c2fd17838 (diff)
2003-04-13 Havoc Pennington <hp@pobox.com>
* dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting callbacks * test/data/valid-config-files/debug-allow-all.conf.in: allow all users * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status): fix to only recover unused bytes if we're already authenticated (_dbus_transport_get_is_authenticated): fix to still mark us authenticated if there are unused bytes. * bus/dispatch.c: implement security policy checking * bus/connection.c (bus_transaction_send_from_driver): new * bus/bus.c (bus_context_check_security_policy): new * bus/dispatch.c (send_service_nonexistent_error): delete this, now we just set the DBusError and it gets converted to an error reply. * bus/connection.c (allow_user_function): enable code using actual data from the config file * bus/policy.c (list_allows_user): handle wildcard rules for user/group connection perms
Diffstat (limited to 'dbus/dbus-transport.c')
-rw-r--r--dbus/dbus-transport.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index f9b3d8a8..e726de24 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -459,9 +459,21 @@ _dbus_transport_get_is_authenticated (DBusTransport *transport)
maybe_authenticated =
(!(transport->send_credentials_pending ||
- transport->receive_credentials_pending)) &&
- _dbus_auth_do_work (transport->auth) == DBUS_AUTH_STATE_AUTHENTICATED;
+ transport->receive_credentials_pending));
+ if (maybe_authenticated)
+ {
+ switch (_dbus_auth_do_work (transport->auth))
+ {
+ case DBUS_AUTH_STATE_AUTHENTICATED:
+ case DBUS_AUTH_STATE_AUTHENTICATED_WITH_UNUSED_BYTES:
+ /* leave as maybe_authenticated */
+ break;
+ default:
+ maybe_authenticated = FALSE;
+ }
+ }
+
/* If we've authenticated as some identity, check that the auth
* identity is the same as our own identity. In the future, we
* may have API allowing applications to specify how this is
@@ -768,18 +780,18 @@ _dbus_transport_get_dispatch_status (DBusTransport *transport)
if (!_dbus_transport_get_is_authenticated (transport))
{
- switch (_dbus_auth_do_work (transport->auth))
- {
- case DBUS_AUTH_STATE_WAITING_FOR_MEMORY:
- return DBUS_DISPATCH_NEED_MEMORY;
- case DBUS_AUTH_STATE_AUTHENTICATED_WITH_UNUSED_BYTES:
- if (!recover_unused_bytes (transport))
- return DBUS_DISPATCH_NEED_MEMORY;
- break;
- default:
- break;
- }
+ if (_dbus_auth_do_work (transport->auth) ==
+ DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
+ return DBUS_DISPATCH_NEED_MEMORY;
+ else
+ return DBUS_DISPATCH_COMPLETE;
}
+
+ if (!transport->unused_bytes_recovered &&
+ !recover_unused_bytes (transport))
+ return DBUS_DISPATCH_NEED_MEMORY;
+
+ transport->unused_bytes_recovered = TRUE;
if (!_dbus_message_loader_queue_messages (transport->loader))
return DBUS_DISPATCH_NEED_MEMORY;