summaryrefslogtreecommitdiff
path: root/dbus/dbus-transport.h
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-08-23 00:43:02 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2013-08-23 00:45:11 +0200
commit36bb2125d1dbca0ee30fbe29090c4a6a7be37854 (patch)
tree9d1c3d9c0c1ba305666d6a0aed8e689bab946fc1 /dbus/dbus-transport.h
parent1809c7ad2a72b7186bbff0180aaae72337055829 (diff)
downloaddbus-36bb2125d1dbca0ee30fbe29090c4a6a7be37854.tar.gz
Fix confusion between "is it authenticated?" and "try to authenticate"
Historically, _dbus_transport_get_is_authenticated() has had the side-effect of trying to advance the authentication state machine (if there's enough buffered input to do so). This seems an inappropriate activity for what looks like a simple getter. Split it into _dbus_transport_try_to_authenticate (which does what it always used to do) and _dbus_transport_peek_is_authenticated (which is the simple getter version). To minimize the difference in behaviour for the stable branch of D-Bus, I've only used _dbus_transport_peek_is_authenticated where it was used in an assertion, which should clearly not have side effects (and I've checked that the asserting function cannot be called until both authentication and authorization have completed). Replacing most of the calls to get_is_authenticated with try_to_authenticate is a possible piece of future work. Based on patches from Cosimo Alfarano, who noticed this assertion-with-side-effects. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> https://bugs.freedesktop.org/show_bug.cgi?id=39720 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.com>
Diffstat (limited to 'dbus/dbus-transport.h')
-rw-r--r--dbus/dbus-transport.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dbus/dbus-transport.h b/dbus/dbus-transport.h
index 4b821517..80fa24ef 100644
--- a/dbus/dbus-transport.h
+++ b/dbus/dbus-transport.h
@@ -38,7 +38,8 @@ DBusTransport* _dbus_transport_ref (DBusTransport
void _dbus_transport_unref (DBusTransport *transport);
void _dbus_transport_disconnect (DBusTransport *transport);
dbus_bool_t _dbus_transport_get_is_connected (DBusTransport *transport);
-dbus_bool_t _dbus_transport_get_is_authenticated (DBusTransport *transport);
+dbus_bool_t _dbus_transport_peek_is_authenticated (DBusTransport *transport);
+dbus_bool_t _dbus_transport_try_to_authenticate (DBusTransport *transport);
dbus_bool_t _dbus_transport_get_is_anonymous (DBusTransport *transport);
dbus_bool_t _dbus_transport_can_pass_unix_fd (DBusTransport *transport);