diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-08-23 00:43:02 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2013-08-23 00:45:11 +0200 |
commit | 36bb2125d1dbca0ee30fbe29090c4a6a7be37854 (patch) | |
tree | 9d1c3d9c0c1ba305666d6a0aed8e689bab946fc1 /bus | |
parent | 1809c7ad2a72b7186bbff0180aaae72337055829 (diff) | |
download | dbus-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 'bus')
0 files changed, 0 insertions, 0 deletions