dbus/bus
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 Ignore generated bus/org.freedesktop.dbus-session.plist 2010-12-15 09:43:11 +01:00
activation-exit-codes.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation-helper-bin.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation-helper.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
activation-helper.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
activation.c Merge branch 'socket-set-33337' 2012-02-07 15:04:25 +00:00
activation.h activation: optionally, use systemd for system bus activation 2010-07-09 19:47:23 +02:00
bus.c Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
bus.h Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
config-loader-expat.c Fixed gcc on windows limitation 2010-03-20 21:53:57 +01:00
config-loader-libxml.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
config-parser-common.c Do not use the name ELEMENT_TYPE 2011-03-07 13:50:38 +00:00
config-parser-common.h Do not use the name ELEMENT_TYPE 2011-03-07 13:50:38 +00:00
config-parser-trivial.c Fix spelling/grammatical mistakes detected by Debian's lintian(1) 2011-07-28 11:05:43 +01:00
config-parser-trivial.h Merge branch 'dbus-1.2' 2010-06-22 17:25:20 +01:00
config-parser.c test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
config-parser.h Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
connection.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
connection.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dbus.service.in bus: introduce --nopidfile switch to disable writing of PID files 2012-02-10 10:07:24 +00:00
dbus.socket.in systemd: enable the dbus service unconditionally 2010-09-06 03:21:17 +02:00
desktop-file.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
desktop-file.h activation: optionally, use systemd for system bus activation 2010-07-09 19:47:23 +02:00
dir-watch-default.c Fix warnings on Windows builds. 2010-04-14 08:26:40 +02:00
dir-watch-dnotify.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
dir-watch-inotify.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dir-watch-kqueue.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dir-watch.h Clean up inotify watch handling 2010-02-01 16:22:56 -05:00
dispatch.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dispatch.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
driver.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
driver.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
expirelist.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
expirelist.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
main.c Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
Makefile.am Revert "made session service dirs customizable: autotools part" 2012-01-04 18:19:58 +00:00
messagebus-config.in Applied patches from cygwin port. 2010-08-10 08:25:24 +02:00
messagebus.in Fix use of $servicename in status 2010-07-09 11:52:59 -04:00
org.freedesktop.dbus-session.plist.in 10.4 is old so set more sensible launchd defaults. 2010-12-09 08:20:07 +01:00
policy.c test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
policy.h test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
rc.messagebus.in [legacy init script] Fix the use of $servicename 2010-04-23 12:02:19 -04:00
selinux.c capng: Drop supplemental groups when switching to daemon user 2011-08-11 10:54:45 +01:00
selinux.h Fix compilation in --disable-selinux case 2010-02-02 15:04:58 -05:00
services.c policy: remove unused parameter 2012-03-22 11:28:58 +00:00
services.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
session.conf.in Revert "made session service dirs customizable: cmake part" 2012-01-04 18:20:15 +00:00
signals.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
signals.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
stats.c Revert addition of files which were only meant to exist on master, too 2012-01-23 10:27:32 +00:00
stats.h Revert addition of files which were only meant to exist on master, too 2012-01-23 10:27:32 +00:00
system.conf.in Clean up and clarify default system policy 2008-12-18 15:34:24 -05:00
test-launch-helper.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-main.c Move _dbus_check_fdleaks_enter to dbus-message-internal.h 2012-02-21 14:51:21 +00:00
test-system.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test.c Replace a series of booleans, all (apparently) alike, with flags 2012-02-13 17:39:16 +00:00
test.h Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
utils.c Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00
utils.h Bug 21161 - Update the FSF address 2009-07-14 15:39:47 -04:00