platform/upstream/dbus.git
10 years agoAdd doc to load_ex_ip_helper_procedures().
Ralf Habacker [Thu, 8 Aug 2013 14:52:54 +0000 (16:52 +0200)]
Add doc to load_ex_ip_helper_procedures().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoOnly take process id of localhost client connection entries.
Ralf Habacker [Thu, 8 Aug 2013 14:48:04 +0000 (16:48 +0200)]
Only take process id of localhost client connection entries.

This patch makes sure, that the process id is fetched only from localhost
 client address connections fetched from the tcp table.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed bug of unsupported GetExtendTcpTable() on Windows XP SP2 and earlier.
Ralf Habacker [Wed, 7 Aug 2013 18:47:55 +0000 (20:47 +0200)]
Fixed bug of unsupported GetExtendTcpTable() on Windows XP SP2 and earlier.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDump fetched sid on return of _dbus_getsid().
Ralf Habacker [Sat, 29 Jun 2013 11:46:53 +0000 (13:46 +0200)]
Dump fetched sid on return of _dbus_getsid().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd WINXP <= SP3 support to _dbus_getsid().
Ralf Habacker [Sat, 29 Jun 2013 11:45:41 +0000 (13:45 +0200)]
Add WINXP <= SP3 support to _dbus_getsid().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agotest/marshal: Ensure we use suitably aligned buffers
Colin Walters [Wed, 24 Jul 2013 20:48:58 +0000 (21:48 +0100)]
test/marshal: Ensure we use suitably aligned buffers

This test was failing on s390; though it could fail
on other platforms too.  Basically we need to be sure
we're passing at least word-aligned buffers to the
demarshalling code.  malloc() will do that for us.

https://bugs.freedesktop.org/show_bug.cgi?id=67279

10 years agoNEWS for 1.7.x
Simon McVittie [Mon, 1 Jul 2013 11:24:53 +0000 (12:24 +0100)]
NEWS for 1.7.x

10 years agocmake: do not bind to any particular POSIX C standard
Chengwei Yang [Fri, 28 Jun 2013 12:26:28 +0000 (20:26 +0800)]
cmake: do not bind to any particular POSIX C standard

This caused build failures on FreeBSD. Defining _POSIX_C_SOURCE to
a particular version will disable common non-POSIX extensions like
PF_UNIX, and on some systems will also disable features of later
POSIX versions, like IPv6. If we don't ask for a specific version,
we'll get some sort of sensible default.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66257
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[made the commit message more concise -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Mon, 1 Jul 2013 11:16:05 +0000 (12:16 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

10 years agoNEWS for 1.6.x
Simon McVittie [Mon, 1 Jul 2013 11:15:04 +0000 (12:15 +0100)]
NEWS for 1.6.x

10 years agoMake the test for #53499 more obviously correct
Simon McVittie [Mon, 1 Jul 2013 11:14:02 +0000 (12:14 +0100)]
Make the test for #53499 more obviously correct

10 years agoTest: add a test case for escaping byte > 127
Chengwei Yang [Sat, 29 Jun 2013 04:21:27 +0000 (12:21 +0800)]
Test: add a test case for escaping byte > 127

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>
10 years agoFix: a non ascii byte will trigger BadAddress error
Chengwei Yang [Sat, 29 Jun 2013 03:56:20 +0000 (11:56 +0800)]
Fix: a non ascii byte will trigger BadAddress error

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>
10 years agotests to embedded tests: replaced in cmake files
Chengwei Yang [Fri, 28 Jun 2013 08:23:03 +0000 (16:23 +0800)]
tests to embedded tests: replaced in cmake files

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=66291

10 years agotests to embedded tests: replaced in automake files
Chengwei Yang [Fri, 28 Jun 2013 08:06:41 +0000 (16:06 +0800)]
tests to embedded tests: replaced in automake files

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=66291

10 years agotests to embedded tests: replaced in libdbus
Chengwei Yang [Fri, 28 Jun 2013 08:25:54 +0000 (16:25 +0800)]
tests to embedded tests: replaced in libdbus

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=66291

10 years agotests to embedded tests: replaced in tools
Chengwei Yang [Fri, 28 Jun 2013 08:26:27 +0000 (16:26 +0800)]
tests to embedded tests: replaced in tools

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=66291

10 years agotests to embedded tests: replaced in dbus-daemon
Chengwei Yang [Fri, 28 Jun 2013 08:24:37 +0000 (16:24 +0800)]
tests to embedded tests: replaced in dbus-daemon

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=66291

10 years agoDBusString: fix a typo
Chengwei Yang [Fri, 28 Jun 2013 06:40:42 +0000 (14:40 +0800)]
DBusString: fix a typo

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[separated out of a larger patch -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66300

10 years agoNEWS for 33001
Simon McVittie [Fri, 28 Jun 2013 11:03:05 +0000 (12:03 +0100)]
NEWS for 33001

10 years agocmake: align dir watch backend detection with autotools
Chengwei Yang [Fri, 28 Jun 2013 02:48:15 +0000 (10:48 +0800)]
cmake: align dir watch backend detection with autotools

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=66257

10 years agocmake: terminate to generate makefiles due to fatal error
Chengwei Yang [Fri, 28 Jun 2013 02:27:08 +0000 (10:27 +0800)]
cmake: terminate to generate makefiles due to fatal error

FATAL isn't a valid key for message according to cmake document here.
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command%3amessage

Due to the real fatal error, FATAL_ERROR should be used to terminate
cmake from continue generating makefiles.

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=66257

10 years agocmake: get rid of useless commented out code
Chengwei Yang [Fri, 28 Jun 2013 02:23:12 +0000 (10:23 +0800)]
cmake: get rid of useless commented out code

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=66257

10 years agodir-watch: remove dnotify backend
Chengwei Yang [Fri, 28 Jun 2013 01:36:32 +0000 (09:36 +0800)]
dir-watch: remove dnotify backend

dnotify as a dir watch backend is broken since Jan 2010 (almost 3.5
years). According to fd.o: #33001, it's no harm to remove dnotify from
this project.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33001
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agocmake: clean up libxml2 glue
Chengwei Yang [Fri, 28 Jun 2013 02:18:35 +0000 (10:18 +0800)]
cmake: clean up libxml2 glue

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=66257

10 years agoNEWS for master
Simon McVittie [Fri, 28 Jun 2013 10:47:15 +0000 (11:47 +0100)]
NEWS for master

10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Fri, 28 Jun 2013 10:38:33 +0000 (11:38 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

10 years agoNEWS
Simon McVittie [Fri, 28 Jun 2013 10:37:28 +0000 (11:37 +0100)]
NEWS

10 years agoRemove invoke of va_end before va_start
Chengwei Yang [Fri, 28 Jun 2013 06:34:22 +0000 (14:34 +0800)]
Remove invoke of va_end before va_start

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

10 years agoFix two small typos in README.win
Chengwei Yang [Fri, 28 Jun 2013 05:55:14 +0000 (13:55 +0800)]
Fix two small typos in README.win

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

10 years agokqueue: remove unused variable
Chengwei Yang [Wed, 26 Jun 2013 13:35:09 +0000 (21:35 +0800)]
kqueue: remove unused variable

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=66035

10 years agodbus-launch: do not verbose output if build with verbose mode disabled
Chengwei Yang [Wed, 26 Jun 2013 12:31:07 +0000 (20:31 +0800)]
dbus-launch: do not verbose output if build with verbose mode disabled

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=66068

10 years agodbus-launch: align document
Chengwei Yang [Sun, 23 Jun 2013 02:49:09 +0000 (10:49 +0800)]
dbus-launch: align document

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=66068

10 years agodbus-launch: fix coding style
Chengwei Yang [Wed, 26 Jun 2013 12:26:37 +0000 (20:26 +0800)]
dbus-launch: fix coding style

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=66068

10 years agoFreeBSD: explicit include signal.h to fix build failure
Chengwei Yang [Wed, 26 Jun 2013 07:40:12 +0000 (15:40 +0800)]
FreeBSD: explicit include signal.h to fix build failure

In Linux envrionment, signal.h included by sys/wait.h, however, this
isn't the case in FreeBSD. So explicit include it to fix build failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66197
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix build failure if build with tests but without verbose mode
Chengwei Yang [Fri, 21 Jun 2013 09:58:56 +0000 (17:58 +0800)]
Fix build failure if build with tests but without verbose mode

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66005
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years ago_dbus_message_iter_check: compile non-dummy version if asserting, too
Simon McVittie [Tue, 25 Jun 2013 11:29:30 +0000 (12:29 +0100)]
_dbus_message_iter_check: compile non-dummy version if asserting, too

10 years agoExplicitly define macros to get less confusing conditions
Chengwei Yang [Tue, 25 Jun 2013 07:42:23 +0000 (15:42 +0800)]
Explicitly define macros to get less confusing conditions

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65990
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix build failure if build with checks but without asserts
Chengwei Yang [Tue, 25 Jun 2013 03:34:11 +0000 (11:34 +0800)]
Fix build failure if build with checks but without asserts

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65990
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoConvert a{sv} helpers from Stats into generic utility code
Simon McVittie [Mon, 24 Jun 2013 12:41:33 +0000 (13:41 +0100)]
Convert a{sv} helpers from Stats into generic utility code

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agocmake: remove a duplicate line and fix coding style
Chengwei Yang [Tue, 25 Jun 2013 05:45:35 +0000 (13:45 +0800)]
cmake: remove a duplicate line and fix coding style

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66142
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoNEWS, noting build-time configuration change
Simon McVittie [Tue, 25 Jun 2013 11:16:54 +0000 (12:16 +0100)]
NEWS, noting build-time configuration change

10 years agocmake: fix a typo DBUS_DISABLE_ASSERTS should be DBUS_DISABLE_ASSERT
Chengwei Yang [Tue, 25 Jun 2013 07:37:27 +0000 (15:37 +0800)]
cmake: fix a typo DBUS_DISABLE_ASSERTS should be DBUS_DISABLE_ASSERT

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66142
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoUse Doxyfile.in for cmake build system too.
Ralf Habacker [Thu, 20 Jun 2013 14:46:15 +0000 (16:46 +0200)]
Use Doxyfile.in for cmake build system too.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64875
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix build failure if build with "--enable-stats"
Chengwei Yang [Fri, 21 Jun 2013 09:13:06 +0000 (17:13 +0800)]
Fix build failure if build with "--enable-stats"

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66004
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDBus Specification: remove incorrect table description
Chengwei Yang [Mon, 24 Jun 2013 08:00:29 +0000 (16:00 +0800)]
DBus Specification: remove incorrect table description

I doubt this line was copied by mistake from section "Summary of types".

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=66115

10 years agoLet dbus-daemon not print unavailable options on windows.
Ralf Habacker [Wed, 23 Jan 2013 12:14:17 +0000 (13:14 +0100)]
Let dbus-daemon not print unavailable options on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42441
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoconnection: Add incoming message serials to verbose mode logging
Colin Walters [Tue, 2 Apr 2013 20:20:45 +0000 (16:20 -0400)]
connection: Add incoming message serials to verbose mode logging

This helps pair up messages with verbose mode output from the other
side of a connection.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63047
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoNEWS
Simon McVittie [Thu, 20 Jun 2013 12:32:20 +0000 (13:32 +0100)]
NEWS

10 years agodbus-send: Fix fail to run without "--dest" option
Chengwei Yang [Wed, 19 Jun 2013 08:35:43 +0000 (16:35 +0800)]
dbus-send: Fix fail to run without "--dest" option

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65923
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Thu, 20 Jun 2013 12:24:41 +0000 (13:24 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

10 years agoNEWS for #65959
Simon McVittie [Thu, 20 Jun 2013 12:20:08 +0000 (13:20 +0100)]
NEWS for #65959

10 years agoDBusString: fix may crash if try to free an uninitialized str
Chengwei Yang [Thu, 20 Jun 2013 09:24:04 +0000 (17:24 +0800)]
DBusString: fix may crash if try to free an uninitialized str

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>
10 years agoDoc: fix invalid usage of doxygen @param command
Chengwei Yang [Sat, 15 Jun 2013 07:42:19 +0000 (15:42 +0800)]
Doc: fix invalid usage of doxygen @param command

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=65755

10 years agoFix of cmake xmldoc dependencies chain.
Ralf Habacker [Tue, 18 Jun 2013 12:07:38 +0000 (14:07 +0200)]
Fix of cmake xmldoc dependencies chain.

This patch fixes an issues that xml documentation is generated on all builds regardless
if related files has been changed or not.

The patch adds a global xmldoc make target to which all generated html or man files are
added as build dependency. Each dependency itself depends on related CMakeLists.txt and
the xml file generated from the related xml.in file.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64058
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed wrong path for generated xml files when creating man pages with cmake.
Ralf Habacker [Tue, 18 Jun 2013 11:42:34 +0000 (13:42 +0200)]
Fixed wrong path for generated xml files when creating man pages with cmake.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64058
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd a statically-initialized implementation of _dbus_lock() on glibc systems
Simon McVittie [Tue, 16 Apr 2013 15:48:11 +0000 (16:48 +0100)]
Add a statically-initialized implementation of _dbus_lock() on glibc systems

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
10 years agoAlways initialize threading before allocating a dynamic mutex
Simon McVittie [Tue, 16 Apr 2013 15:37:51 +0000 (16:37 +0100)]
Always initialize threading before allocating a dynamic mutex

Dynamic allocation of mutexes can fail anyway, so this is easy.

Justification for not keeping the dummy mutex code-paths, even as an
opt-in thing for processes known to be high-performance and
single-threaded: real mutexes only cut the throughput of
test/dbus-daemon.c by a couple of percent on my laptop (from around
6700 to around 6600 messages per second), and libdbus crashes caused
by not calling dbus_threads_init_default() are sufficiently widespread
that they're wasting a lot of everyone's time.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
10 years agoMake taking a global lock automatically initialize locking if needed
Simon McVittie [Tue, 16 Apr 2013 15:28:44 +0000 (16:28 +0100)]
Make taking a global lock automatically initialize locking if needed

This lets them be thread-safe by default, at the cost that they can
now fail.

init_uninitialized_locks() and init_global_locks() must now both
reimplement the equivalent of _dbus_register_shutdown_func(), by using
_dbus_platform_rmutex_lock() on the same underlying mutex around a call
to _dbus_register_shutdown_func_unlocked().

This is because if they used the usual _DBUS_LOCK() API (as
_dbus_register_shutdown_func() does), it would automatically try to
initialize global locking, leading to infinite recursion.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
10 years agoReplace individual global-lock variables with an array of DBusRMutex *
Simon McVittie [Tue, 16 Apr 2013 14:39:54 +0000 (15:39 +0100)]
Replace individual global-lock variables with an array of DBusRMutex *

This means we can use a much simpler code structure in data-slot
allocators: instead of giving them a DBusRMutex ** at first-allocation,
we can just give them an index into the array, which can be done
statically.

It doesn't make us any more thread-safe-by-default - the mutexes will
only actually be used if threads were already initialized - but it's
substantially better than nothing.

These locks really do have to be recursive: for instance,
internal_bus_get() calls dbus_bus_register() under the bus lock,
and dbus_bus_register() can call _dbus_connection_close_possibly_shared(),
which takes the bus lock.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
10 years agostart spec 0.22 development
Simon McVittie [Thu, 2 May 2013 13:50:24 +0000 (14:50 +0100)]
start spec 0.22 development

10 years agoFix Werror=unused-function if build without X11
Simon McVittie [Thu, 13 Jun 2013 15:18:30 +0000 (16:18 +0100)]
Fix Werror=unused-function if build without X11

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65712
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoStart on 1.7.5, add release name for 1.7.4
Simon McVittie [Thu, 13 Jun 2013 12:47:19 +0000 (13:47 +0100)]
Start on 1.7.5, add release name for 1.7.4

10 years agoAdd release name for 1.6.12
Simon McVittie [Thu, 13 Jun 2013 12:46:33 +0000 (13:46 +0100)]
Add release name for 1.6.12

10 years agoPrepare 1.7.4 for tomorrow dbus-1.7.4
Simon McVittie [Wed, 12 Jun 2013 18:49:44 +0000 (19:49 +0100)]
Prepare 1.7.4 for tomorrow

10 years agoMove libdbus-init-win.cpp to its own convenience library
Simon McVittie [Wed, 12 Jun 2013 18:14:40 +0000 (19:14 +0100)]
Move libdbus-init-win.cpp to its own convenience library

Otherwise libdbus-1 ends up linked as if it contained C++, even
on Unix, where it doesn't; in turn, that makes it export all the
underscore-prefixed symbols that aren't meant to be exported.

Reviewed-by: Thiago Macieira <thiago@kde.org>
Reviewed-by: David Zeuthen <davidz@redhat.com>
10 years agoNEWS
Simon McVittie [Wed, 12 Jun 2013 18:01:07 +0000 (19:01 +0100)]
NEWS

10 years agoFix an incorrect comment
Simon McVittie [Wed, 12 Jun 2013 16:27:54 +0000 (17:27 +0100)]
Fix an incorrect comment

_dbus_threads_lock_platform_specific() is implemented on Windows now.

10 years agoRevert "start spec 0.22 development"
Simon McVittie [Wed, 12 Jun 2013 16:25:29 +0000 (17:25 +0100)]
Revert "start spec 0.22 development"

This reverts commit 82b3d94ab10f16e6c6c18eb3bc76594cd63e3854.

10 years ago_dbus_system_logv: copy the va_list here too
Simon McVittie [Tue, 11 Jun 2013 18:20:55 +0000 (19:20 +0100)]
_dbus_system_logv: copy the va_list here too

This would crash if HAVE_SYSLOG_H is defined, HAVE_DECL_LOG_PERROR
is false, and the platform calling convention is that va_list is a
struct. Verified on Linux by undefining HAVE_DECL_LOG_PERROR.

Reviewed-by: Colin Walters <walters@verbum.org>
10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Wed, 12 Jun 2013 13:49:37 +0000 (14:49 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS
configure.ac

10 years agoStart 1.6.13
Simon McVittie [Wed, 12 Jun 2013 13:46:24 +0000 (14:46 +0100)]
Start 1.6.13

10 years agoPrepare embargoed release for tomorrow dbus-1.6.12
Simon McVittie [Wed, 12 Jun 2013 13:02:31 +0000 (14:02 +0100)]
Prepare embargoed release for tomorrow

10 years agoAdd a test-case for CVE-2013-2168
Simon McVittie [Wed, 12 Jun 2013 12:56:39 +0000 (13:56 +0100)]
Add a test-case for CVE-2013-2168

Reviewed-by: Thiago Macieira <thiago@kde.org>
[build system adjusted to compile it even if we don't have GLib -smcv]

10 years agoCVE-2013-2168: _dbus_printf_string_upper_bound: copy the va_list for each use
Simon McVittie [Mon, 10 Jun 2013 17:06:47 +0000 (18:06 +0100)]
CVE-2013-2168: _dbus_printf_string_upper_bound: copy the va_list for each use

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>
10 years agoNEWS for 1.6.x
Simon McVittie [Wed, 12 Jun 2013 12:42:58 +0000 (13:42 +0100)]
NEWS for 1.6.x

10 years agoFix dbus-daemon crash due to invalid service file
Chengwei Yang [Thu, 6 Jun 2013 05:25:10 +0000 (13:25 +0800)]
Fix dbus-daemon crash due to invalid service file

dbus-daemon will crash due to invalid service file which key/value
starts before section. In that situation, new_line() will try to access
invalid address.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60853
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoNEWS
Simon McVittie [Thu, 6 Jun 2013 12:18:06 +0000 (13:18 +0100)]
NEWS

Also update README to not mention libxml2.

10 years agodbus-send: check usage a bit strictly
Chengwei Yang [Thu, 6 Jun 2013 08:58:11 +0000 (16:58 +0800)]
dbus-send: check usage a bit strictly

This commit does several more strictly check for dbus-send as its usage
suggested.

* now --address is an invalid option but --address=, this just like the
  others, say --reply-timeout=, --dest=, --type=
* --print-reply= only take an optional argument "=literal"
* --print-reply= will cause error with missing MSEC and invalid MSEC
  will cause invalid value error
* --dest= will cause error with missing a NAME and also call
  dbus_validate_bus_name to verify the NAME

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65424
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAssign default value to enable compiler coverage
Chengwei Yang [Thu, 6 Jun 2013 08:11:16 +0000 (16:11 +0800)]
Assign default value to enable compiler coverage

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65424
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix a typo: enable_x11 -> have_x11
Chengwei Yang [Thu, 6 Jun 2013 08:12:01 +0000 (16:12 +0800)]
Fix a typo: enable_x11 -> have_x11

From git history, enable_x11 was used to track have_x11, but it's
useless now.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65443
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoXML: hard depends on expat and delete libxml
Chengwei Yang [Thu, 6 Jun 2013 07:59:20 +0000 (15:59 +0800)]
XML: hard depends on expat and delete libxml

[The libxml code path has been broken for at least 2.5 years, and Expat
is tiny, so there seems no point in supporting both. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20253
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix dbus-daemon crash due to invalid service file
Chengwei Yang [Thu, 6 Jun 2013 05:25:10 +0000 (13:25 +0800)]
Fix dbus-daemon crash due to invalid service file

dbus-daemon will crash due to invalid service file which key/value
starts before section. In that situation, new_line() will try to access
invalid address.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60853
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDo not suggest user to do 'make' if configure failed
Chengwei Yang [Thu, 6 Jun 2013 03:36:22 +0000 (11:36 +0800)]
Do not suggest user to do 'make' if configure failed

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65415
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agomassively simplify run-with-tmp-session-bus.sh by using dbus-run-session
Simon McVittie [Tue, 7 Feb 2012 19:58:44 +0000 (19:58 +0000)]
massively simplify run-with-tmp-session-bus.sh by using dbus-run-session

It turns out that if you don't second-guess the system by catching
SIGINT, the right things happen: it's received by every program in the
foreground process group, including dbus-run-session and dbus-daemon.
Neither of those catch SIGINT (unlike dbus-launch) so they'll exit
gracefully without the wrapper script needing to do anything special.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
10 years agoRecomend dbus-run-session over dbus-launch for starting text-mode sessions
Simon McVittie [Wed, 5 Jun 2013 16:51:55 +0000 (17:51 +0100)]
Recomend dbus-run-session over dbus-launch for starting text-mode sessions

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
[reformatted from roff to Docbook -smcv]

10 years agoPut dbus-run-session through doclifter and adjust to match other man pages
Simon McVittie [Wed, 5 Jun 2013 16:55:03 +0000 (17:55 +0100)]
Put dbus-run-session through doclifter and adjust to match other man pages

10 years agoAdd dbus-run-session
Simon McVittie [Tue, 7 Feb 2012 17:45:16 +0000 (17:45 +0000)]
Add dbus-run-session

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
10 years agoFix build error: unused-result
Chengwei Yang [Fri, 31 May 2013 07:02:45 +0000 (15:02 +0800)]
Fix build error: unused-result

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoWhen "activating" systemd, handle its special case better
Chengwei Yang [Wed, 29 May 2013 12:50:21 +0000 (20:50 +0800)]
When "activating" systemd, handle its special case better

When dbus-daemon receives a request to activate a systemd service before
systemd has connected to it, it enqueues a fake request to "activate"
systemd itself (as a way to get a BusPendingActivationEntry to track the
process of waiting for systemd). When systemd later joins the bus,
dbus-daemon sends the actual activation message; any future activation
messages are sent directly to systemd.

In the "pending" code path, the activation messages are currently
dispatched as though they had been sent by the same process that sent
the original activation request, which is wrong: the bus security
policy probably doesn't allow that process to talk to systemd directly.
They should be dispatched as though they had been sent by the
dbus-daemon itself (connection == NULL), the same as in the non-pending
code path.

In the worst case, if the attempt to activate systemd timed out, the
dbus-daemon would crash with a (fatal) warning, because in this special
case, activation_message is a signal with no serial number, whereas the
code to send an error reply is expecting a method call with a serial
number.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50199
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Tested-by: Ma Yu <yu.ma@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoNEWS
Simon McVittie [Wed, 5 Jun 2013 16:00:40 +0000 (17:00 +0100)]
NEWS

10 years agoFix build error: unused-result
Chengwei Yang [Fri, 31 May 2013 07:02:45 +0000 (15:02 +0800)]
Fix build error: unused-result

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agodoc: fix a little bit for dbus-send
Chengwei Yang [Fri, 31 May 2013 09:36:04 +0000 (17:36 +0800)]
doc: fix a little bit for dbus-send

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoWhen "activating" systemd, handle its special case better
Chengwei Yang [Wed, 29 May 2013 12:50:21 +0000 (20:50 +0800)]
When "activating" systemd, handle its special case better

When dbus-daemon receives a request to activate a systemd service before
systemd has connected to it, it enqueues a fake request to "activate"
systemd itself (as a way to get a BusPendingActivationEntry to track the
process of waiting for systemd). When systemd later joins the bus,
dbus-daemon sends the actual activation message; any future activation
messages are sent directly to systemd.

In the "pending" code path, the activation messages are currently
dispatched as though they had been sent by the same process that sent
the original activation request, which is wrong: the bus security
policy probably doesn't allow that process to talk to systemd directly.
They should be dispatched as though they had been sent by the
dbus-daemon itself (connection == NULL), the same as in the non-pending
code path.

In the worst case, if the attempt to activate systemd timed out, the
dbus-daemon would crash with a (fatal) warning, because in this special
case, activation_message is a signal with no serial number, whereas the
code to send an error reply is expecting a method call with a serial
number.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50199
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Tested-by: Ma Yu <yu.ma@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoRemove unused global mutexes for win_fds, sid_atom_cache
Simon McVittie [Tue, 16 Apr 2013 11:14:02 +0000 (12:14 +0100)]
Remove unused global mutexes for win_fds, sid_atom_cache

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoTurn a runtime assertion into a compile-time assertion
Simon McVittie [Tue, 16 Apr 2013 11:14:14 +0000 (12:14 +0100)]
Turn a runtime assertion into a compile-time assertion

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoNEWS for part 1 of fd.o#54972
Simon McVittie [Fri, 10 May 2013 11:59:35 +0000 (12:59 +0100)]
NEWS for part 1 of fd.o#54972

11 years agodbus_threads_init_default, dbus_threads_init: be safe to call at any time
Simon McVittie [Tue, 16 Apr 2013 11:07:23 +0000 (12:07 +0100)]
dbus_threads_init_default, dbus_threads_init: be safe to call at any time

On Unix, we use a pthreads mutex, which can be allocated and
initialized in global memory.

On Windows, we use a CRITICAL_SECTION, together with a call to
InitializeCriticalSection() from the constructor of a global static
C++ object (thanks to Ralf Habacker for suggesting this approach).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoFix compiler warnings when X11 autolaunch and launchd are both disabled
Simon McVittie [Wed, 8 May 2013 14:26:14 +0000 (15:26 +0100)]
Fix compiler warnings when X11 autolaunch and launchd are both disabled

From the department of "if it isn't tested, it doesn't work". I tried
compiling dbus without an assortment of optional features:

    in_builddir ~/build/dbus/legacy ${MR_REPO}/configure \
        --enable-developer --enable-maintainer-mode --enable-tests \
        dbus_cv_sync_sub_and_fetch=no \
        --disable-selinux \
        --disable-inotify \
        --disable-dnotify \
        --disable-epoll \
        --disable-kqueue \
        --disable-launchd \
        --disable-systemd \
        --disable-libaudit \
        --without-valgrind \
        --disable-x11-autolaunch \
        && ...

and it resulted in -Wunused warnings.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64362
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
11 years agodbus_threads_init: call _dbus_threads_init_platform_specific()
Simon McVittie [Mon, 15 Apr 2013 12:54:39 +0000 (13:54 +0100)]
dbus_threads_init: call _dbus_threads_init_platform_specific()

This reverses the relationship between these two functions.
Previously, dbus_threads_init() wouldn't allocate dbus_cond_event_tls
on Windows, call check_monotonic_clock on Unix, or call
_dbus_check_setuid on Unix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>