summaryrefslogtreecommitdiff
path: root/dbus
AgeCommit message (Collapse)AuthorFilesLines
2014-11-06CVE-2014-7824: set fd rlimit to 64k for the system dbus-daemonSimon McVittie3-32/+159
This ensures that our rlimit is actually high enough to avoid the denial of service described in CVE-2014-3636 part A. CVE-2014-7824 has been allocated for this incomplete fix. Restore the original rlimit for activated services, to avoid them getting undesired higher limits. (Thanks to Alban Crequy for various adjustments which have been included in this commit.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85105 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Conflicts: dbus/dbus-sysdeps-util-unix.c
2014-09-15_dbus_read_socket_with_unix_fds: do not accept extra fds in cmsg paddingSimon McVittie1-6/+43
This addresses CVE-2014-3635. If (*n_fds * sizeof (int) % sizeof (size_t)) is nonzero, then CMSG_SPACE (*n_fds * sizeof (int)) > CMSG_LEN (*n_fds * sizeof (int) because the SPACE includes padding to a size_t boundary, whereas the LEN does not. We have to allocate the SPACE. Previously, we told the kernel that the buffer size we wanted was the SPACE, not the LEN, which meant it was free to fill the padding with additional fds: on a 64-bit platform with 32-bit int, that's one extra fd, if *n_fds happens to be odd. This meant that a malicious sender could send exactly 1 fd too many, which would make us fail an assertion if enabled, or overrun a buffer by 1 fd otherwise. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83622 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> (cherry picked from commit ee11ec12566afda5dee8a3a834274421a20661de)
2014-09-15Add _DBUS_GNUC_UNUSED, and use it in _DBUS_STATIC_ASSERTSimon McVittie2-1/+4
This means we can use _DBUS_STATIC_ASSERT at non-global scope without tripping -Wunused-local-typedefs. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83767 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> (cherry picked from commit 0e3d08d45cb9a9ceb2c077875eeb38306dad37b8) (cherry picked from commit f70c0e98c5cc6eaae4727d14c389e2504e79e694)
2014-09-15DBusConnection: implements _dbus_connection_set_pending_fds_functionAlban Crequy7-0/+70
This is one of four commits needed to address CVE-2014-3637. This will allow the bus to be notified whenever a file descriptor is added or removed from a DBusConnection's DBusMessageLoader. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit 8021fd84267ee1394d96f4a119adb57de3971a62) Conflicts: dbus/dbus-message.c
2014-09-15DBusConnection: implements _dbus_connection_get_pending_fds_countAlban Crequy6-0/+40
This is one of four commits needed to address CVE-2014-3637. This will allow the bus to know whether there are pending file descriptors in a DBusConnection's DBusMessageLoader. https://bugs.freedesktop.org/show_bug.cgi?id=80559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [fix compilation on platforms that do not HAVE_UNIX_FD_PASSING -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit 995734750cea65012537748ee56488c707d2f027) Conflicts: dbus/dbus-message.c
2014-09-15Stop listening on DBusServer sockets when reaching max_incomplete_connectionsAlban Crequy4-17/+30
This addresses the parts of CVE-2014-3639 not already addressed by reducing the default authentication timeout. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80851 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80919 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit 8ad179a8dad789fc6a5402780044bc0ec3d41115)
2014-09-15config: add new limit: pending_fd_timeoutSimon McVittie2-1/+10
When a file descriptor is passed to dbus-daemon, the associated D-Bus message might not be fully sent to dbus-daemon yet. Dbus-daemon keeps the file descriptor in the DBusMessageLoader of the connection, waiting for the rest of the message. If the client stops sending the remaining bytes, dbus-daemon will wait forever and keep that file descriptor. This patch adds pending_fd_timeout (milliseconds) in the configuration to disconnect a connection after a timeout when a file descriptor was sent but not the remaining message. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Conflicts: cmake/bus/dbus-daemon.xml
2014-06-30Handle ETOOMANYREFS when sending recursive fds (SCM_RIGHTS)Alban Crequy3-1/+48
Since Linux commit 25888e (from 2.6.37-rc4, Nov 2010), sendmsg() on Unix sockets returns -1 errno=ETOOMANYREFS ("Too many references: cannot splice") when the passfd mechanism (SCM_RIGHTS) is "abusively" used recursively by applications. A malicious client could use this to force a victim system service to be disconnected from the system bus; the victim would likely respond by exiting. This is a denial of service (fd.o #80163, CVE-2014-3532). This patch silently drops the D-Bus message on ETOOMANYREFS and does not close the connection. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80163 Reviewed-by: Thiago Macieira <thiago@kde.org> [altered commit message to explain DoS significance -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-06-30If loader contains two messages with fds, don't corrupt the secondSimon McVittie1-1/+1
There were two bugs here: we would previously overwrite the unused fds with the already-used fds instead of the other way round, and we would copy n bytes where we should have copied n ints. Additionally, sending crafted messages in a chosen sequence to a victim system service could cause an invalid file descriptor to be present when dbus-daemon tries to forward one of those crafted messages to the victim, causing sendmsg() to fail with EBADF, which resulted in disconnecting the victim service, which would likely respond to that by exiting. This is a denial of service (fd.o #80469, CVE-2014-3533). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=79694 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80469 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2013-11-04make_and_run_test_nodes: avoid undefined behaviourDreamNik1-2/+5
In code that looks like n[i] = v(&i), where v increments i, C leaves it undefined whether the old or new value of i is used to locate n[i]. As it happens, gcc used the pre-increment value of i, but MSVC used the post-increment value. Fix this by inserting a sequence point to disambiguate the intended order. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69924 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [wrote commit message, fixed whitespace -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-16dbus-sysdeps-unix.c: undeclared ret2 variable if HAVE_WRITEV undefined.Vasiliy Balyasnyy1-1/+1
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69409
2013-09-16Fix a NULL dereference on an error code path.Sviatoslav Chagaev1-1/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69327 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Check EINVAL for accept4()Chengwei Yang1-2/+6
It was reported that accept4() will return -1 with errrno is EINVAL on arm platform, so check EINVAL for accept4() and retry accept(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69026 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Allow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpairPino Toscano1-3/+3
If SOCK_CLOEXEC is defined (usually because accept4 is implemented), check for EPROTOTYPE (the POSIX errno for invalid socket types) in addition to EINVAL as errno indicating whether socket and socketpair do not support SOCK_CLOEXEC (and other SOCK_* flags). [adapted by Chengwei Yang to give _dbus_connect_exec() the same treatment] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69073 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Check EINVAL for socketpair and retry without SOCK_CLOEXECChengwei Yang1-5/+16
As the same as _dbus_open_socket() and _dbus_full_duplex_pipe(), socketpair() may fail with EINVAL if call with SOCK_CLOEXEC. Check for the failure and retry without SOCK_CLOEXEC, in addition, only call _dbus_fd_set_close_on_exec() if the socketpair failure happened. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69073 [trivial coding style fixes -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Use the argument of dbus_connection_set_route_peer_messages()Chengwei Yang1-1/+1
The function dbus_connection_set_route_peer_messages() take a bool argument, however, in the implementation, it always hard-code to TRUE rather than take its bool argument. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69165 [amended commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Fix file descriptor leak in _dbus_command_for_pidSviatoslav Chagaev1-0/+1
Fix a file descriptor not being closed when an error codepath is taken. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69182 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [more specific commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-05_dbus_babysitter_unref: avoid infinite loop if waitpid() returns EINTRSimon McVittie1-5/+8
If waitpid() failed with EINTR, we'd go back for another go, but because ret is nonzero, we'd skip the waitpid() and just keep looping. Also avoid an unnecessary "goto" in favour of a proper loop, to make it more clearly correct. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68945 Reviewed-by: Colin Walters <walters@verbum.org>
2013-09-05Use iface instead of interface in function parametersIvan Romanov2-37/+37
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66493 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit 0928169cf80bf767f7246ecaa52cc01e198bb15a)
2013-07-01Make the test for #53499 more obviously correctSimon McVittie1-1/+1
2013-07-01Test: add a test case for escaping byte > 127Chengwei Yang1-1/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-07-01Fix: a non ascii byte will trigger BadAddress errorChengwei Yang3-5/+5
If a byte in DBusString *unescaped isn't a ascii byte, which will be cast to char (signed char on most of platform), so that's the issue unsigned char cast to signed char. e.g. "\303\266" is a valid unicode character, if everything goes right, it will be escaped to "%c3%b6". However, in fact, it escaped to "%<garbage-byte>3%<garbage-byte>6". _dbus_string_append_byte_as_hex() take an int parameter, so negative byte is valid, but cause get a negative index in array. So garbage value will get. e.g. '\303' --> hexdigits[((signed byte)(-61)) >> 4] is hexdigits[-4]. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499 Sgne-off-by: Chengwei Yang <chengwei.yang@intel.com> [fixed whitespace -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-28Remove invoke of va_end before va_startChengwei Yang1-2/+1
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66300
2013-06-20DBusString: fix may crash if try to free an uninitialized strChengwei Yang1-0/+8
If the str will be freed hasn't been initialized by _dbus_string_init correctly, _dbus_string_free may crash due to trying to free an undefined memory. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65959 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-12CVE-2013-2168: _dbus_printf_string_upper_bound: copy the va_list for each useSimon McVittie2-5/+20
Using a va_list more than once is non-portable: it happens to work under the ABI of (for instance) x86 Linux, but not x86-64 Linux. This led to _dbus_printf_string_upper_bound() crashing if it should have returned exactly 1024 bytes. Many system services can be induced to process a caller-controlled string in ways that end up using _dbus_printf_string_upper_bound(), so this is a denial of service. Reviewed-by: Thiago Macieira <thiago@kde.org>
2013-04-22Accept non-characters when validating UnicodeSimon McVittie1-9/+1
Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE (for n in the range 0 to 0x10), U+nFFFF (for n in the same range), and U+FDD0..U+FDEF are valid for interchange, and their presence does not make a string ill-formed. GLib 2.36 made the corresponding change in its definition of UTF-8 as used by g_utf8_validate() and similar functions. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-05Don't access random memory if data slot isn't allocated yetDan Williams1-1/+2
If DBUS_DISABLE_ASSERTS was turned on, and a buggy program called dbus_connection_get_data() with a slot number less than zero (eg, before even allocating the data slot), random memory would be accessed and a random value returned. Anything less than zero is not a valid slot number and should be rejected by libdbus. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63127 Signed-off-by: Dan Williams <dcbw@redhat.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-04-03If alloca.h is available it is required (e.g. on Solaris 10)Dagobert Michelsen1-0/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63071 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-11-09Don't leak temporary fds pointing to /dev/nullMichel HERMIER1-0/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56927 [commit message added -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-11-09Fix building with newer ValgrindArun Raghavan2-10/+10
Newer valgrind (tried with 3.8.0) defines macros so that a terminating semi-colon is required. This fixes usage to follow that convention. [edited to remove comments that are no longer useful -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55932 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-09-28Revert "hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()"Colin Walters2-12/+0
Follow to reverting a556443757b19fee67ef4441141246dd9cfed4f. See https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24 This reverts commit d7ffad72146c2329692e0cf32eb1ac1dbb4fb51c.
2012-09-28Revert "hardening: Use __secure_getenv if available"Colin Walters1-6/+0
It breaks gnome-keyring-daemon at least in some configurations; see https://bugs.freedesktop.org/show_bug.cgi?id=52202#c24 This reverts commit 1a556443757b19fee67ef4441141246dd9cfed4f.
2012-09-28hardening: Use __secure_getenv() in *addition* to _dbus_check_setuid()Colin Walters2-0/+12
This is a further security measure for the case of Linux/glibc when we're linked into a binary that's using filesystem capabilities or SELinux domain transitions (i.e. not plain old setuid). In this case, _dbus_getenv () will return NULL because it will use __secure_getenv(), which handles those via AT_SECURE. https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28hardening: Ensure _dbus_check_setuid() is initialized threadsafe mannerColin Walters1-0/+5
This is a highly theoretical concern, but we might as well. https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28hardening: Use __secure_getenv if availableColin Walters1-0/+6
This helps us in the case where we were executed via filesystem capabilities or a SELinux domain transition, not necessarily a plain old setuid binary. https://bugs.freedesktop.org/show_bug.cgi?id=52202
2012-09-28CVE-2012-3524: Don't access environment variables or run dbus-launch when setuidColin Walters5-0/+93
This matches a corresponding change in GLib. See glib/gutils.c:g_check_setuid(). Some programs attempt to use libdbus when setuid; notably the X.org server is shipped in such a configuration. libdbus never had an explicit policy about its use in setuid programs. I'm not sure whether we should advertise such support. However, given that there are real-world programs that do this currently, we can make them safer with not too much effort. Better to fix a problem caused by an interaction between two components in *both* places if possible. How to determine whether or not we're running in a privilege-escalated path is operating system specific. Note that GTK+'s code to check euid versus uid worked historically on Unix, more modern systems have filesystem capabilities and SELinux domain transitions, neither of which are captured by the uid comparison. On Linux/glibc, the way this works is that the kernel sets an AT_SECURE flag in the ELF auxiliary vector, and glibc looks for it on startup. If found, then glibc sets a public-but-undocumented __libc_enable_secure variable which we can use. Unfortunately, while it *previously* worked to check this variable, a combination of newer binutils and RPM break it: http://www.openwall.com/lists/owl-dev/2012/08/14/1 So for now on Linux/glibc, we fall back to the historical Unix version until we get glibc fixed. On some BSD variants, there is a issetugid() function. On other Unix variants, we fall back to what GTK+ has been doing. Reported-by: Sebastian Krahmer <krahmer@suse.de> Signed-off-by: Colin Walters <walters@verbum.org>
2012-08-13Revert "Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect ↵Simon McVittie2-4/+8
addresses and set better defaults" This reverts commit b5d36dc27d1905d4d46ad7f0097f0ea0e0776adb. On second thoughts, this is too big a change for a stable branch.
2012-08-13Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect addresses and ↵Simon McVittie2-8/+4
set better defaults On Unix, the connect address should basically always be "autolaunch:" but the listen address has to be something you can listen on. On Windows, you can listen on "autolaunch:" or "autolaunch:scope=*install-path", for instance, and the dbus-daemon is involved in the auto-launching process. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38201 Reviewed-by: David Zeuthen <davidz@redhat.com> [default address changed to autolaunch: for interop with GDBus -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-08-09Check HAVE_DECL_LOG_PERROR with #if, not #ifdefJonathan Perkin1-1/+1
It's always defined. [smcv: commit message added] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53286
2012-07-03DBusTransport: do not assert that autolaunch address is non-emptySimon McVittie1-1/+0
dbus-launch can apparently return an empty address under certain circumstances, and dbus_parse_address() in the next line will return a nice DBusError for an empty address rather than aborting the process. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51657 Bug-Debian: http://bugs.debian.org/680027 Reviewed-by: David Zeuthen <davidz@redhat.com>
2012-06-28Properly concat DBUS_CONSOLE_AUTH_DIR with usernameDave Reisner1-2/+3
This removes the assumption that DBUS_CONSOLE_AUTH_DIR ends with a trailing /. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51521 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-06-25dbus_pending_call_set_notify: don't leave the connection locked on OOMSimon McVittie1-2/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51032 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
2012-06-05_dbus_transport_new_for_tcp_socket: add missing commas to addressSimon McVittie1-2/+2
Ralf pointed out that the address doesn't round-trip correctly. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-05Remove duplicate nonce-tcp (service-side) transport on WindowsSimon McVittie1-27/+1
Turns out this was duplicated too. We can just use the platform-independent version, which uses the same code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-06-05Remove duplicate nonce-tcp (client side) transport on WindowsSimon McVittie1-33/+2
_dbus_transport_open_socket is called before _dbus_transport_open_platform_specific, and now handles nonce-tcp, so this version is no longer useful. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
2012-04-25Merge branch 'dbus-1.4'Simon McVittie1-3/+3
Conflicts: NEWS dbus/dbus-internals.c dbus/dbus-mainloop.c dbus/dbus-sysdeps-unix.c dbus/dbus-sysdeps-win.c dbus/dbus-sysdeps.c dbus/dbus-sysdeps.h
2012-04-12Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication methodDavid Zeuthen8-17/+55
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-12Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication methodDavid Zeuthen8-19/+61
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-03-27Build _dbus_string_starts_with_c_str even if not building testsSimon McVittie1-2/+0
It's used by the own_prefix implementation.
2012-03-27Merge branch 'dbus-1.4'Simon McVittie1-12/+6
Conflicts: NEWS configure.ac