dbus/test/name-test
David Zeuthen 8734e4a16f Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method
When libdbus-1 moved to using monotonic time support for the
DBUS_COOKIE_SHA1 authentication was broken, in particular
interoperability with non-libdbus-1 implementations such as GDBus.

The problem is that if monotonic clocks are available in the OS,
_dbus_get_current_time() will not return the number of seconds since
the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus
specification. If both peers are using libdbus-1 it's not a problem
since both ends will use the wrong time and thus agree. However, if
the other end is another implementation and following the spec it will
not work.

First, we change _dbus_get_current_time() back so it always returns
time since the Epoch and we then rename it _dbus_get_real_time() to
make this clear. We then introduce _dbus_get_monotonic_time() and
carefully make all current users of _dbus_get_current_time() use it,
if applicable. During this audit, one of the callers,
_dbus_generate_uuid(), was currently using monotonic time but it was
decided to make it use real time instead.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-04-12 10:53:50 -04:00
..
.gitignore Add autolaunch test to .gitignore 2011-01-06 17:35:35 +00:00
Makefile.am Merge branch 'dbus-1.4' 2011-09-21 11:39:32 +01:00
run-test-systemserver.sh Check for Python; skip Python tests if not found 2011-09-21 11:25:48 +01:00
run-test.sh Check for Python; skip Python tests if not found 2011-09-21 11:25:48 +01:00
test-activation-forking.py Ignore exit code zero from activated services 2010-01-28 17:01:24 -05:00
test-autolaunch.c Check for X even if X11 autolaunching is disabled 2011-05-25 17:38:44 +01:00
test-ids.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-pending-call-dispatch.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
test-pending-call-timeout.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
test-privserver-client.c Remove various never-used variables 2011-08-05 12:26:51 +01:00
test-privserver.c Port test-privserver to windows by using the TEST_LISTEN bus address. 2010-04-13 21:15:41 +02:00
test-shutdown.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-threads-init.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-wait-for-echo.py Bug 18229: Allow signals 2008-12-09 10:17:36 -05:00
tmp-session-like-system.conf Clean up and clarify default system policy 2008-12-18 15:34:24 -05:00