platform/upstream/dbus.git
9 years agoMerge branch 'dbus-1.8'
Simon McVittie [Fri, 8 May 2015 14:37:58 +0000 (15:37 +0100)]
Merge branch 'dbus-1.8'

9 years agoRevert "reader_init: Initialize all fields of struct DBusTypeReader (CID 54754, 54772...
Simon McVittie [Fri, 8 May 2015 14:36:19 +0000 (15:36 +0100)]
Revert "reader_init: Initialize all fields of struct DBusTypeReader (CID 54754, 54772, 54773)."

This reverts commit 21a7873f20145d561c2de8f084d98200a8de2c83.

This appears to cause a segfault, presumably resulting from something
assuming that reader_init() would not reinitialize all fields:

 #0  0x00007ffff7b74777 in _dbus_type_reader_get_current_type (reader=reader@entry=0x7fffffffda50) at .../dbus/dbus-marshal-recursive.c:791
 #1  0x00007ffff7b719d0 in _dbus_header_cache_check (header=<optimized out>)
    at .../dbus/dbus-marshal-header.c:209
 #2  0x00007ffff7b719d0 in _dbus_header_cache_check (header=header@entry=0x624658, field=field@entry=6) at .../dbus/dbus-marshal-header.c:250
 #3  0x00007ffff7b72884 in _dbus_header_get_field_basic (header=header@entry=0x624658, field=field@entry=6, type=type@entry=115, value=value@entry=0x7fffffffdbd8) at .../dbus/dbus-marshal-header.c:1365
 #4  0x00007ffff7b7d8c2 in dbus_message_get_destination (message=message@entry=0x624650) at .../dbus/dbus-message.c:3457
 #5  0x00007ffff7b67be6 in _dbus_connection_send_preallocated_unlocked_no_update (connection=connection@entry=0x6236d0, preallocated=0x0,
    preallocated@entry=0x6234c0, message=message@entry=0x624650, client_serial=client_serial@entry=0x7fffffffdcbc)
    at .../dbus/dbus-connection.c:2017

9 years agoauth_set_unix_credentials: Fix calling _dbus_credentials_add_pid without checking...
Ralf Habacker [Tue, 5 May 2015 15:10:01 +0000 (17:10 +0200)]
auth_set_unix_credentials: Fix calling _dbus_credentials_add_pid without checking return value (CID 54708).

Reported by Coverity: CID 54708: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoauth_set_unix_credentials: Fix calling _dbus_credentials_add_unix_uid without checkin...
Ralf Habacker [Tue, 5 May 2015 15:08:18 +0000 (17:08 +0200)]
auth_set_unix_credentials: Fix calling _dbus_credentials_add_unix_uid without checking return value (CID 54722).

Reported by Coverity: CID 54722: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMerge remote-tracking branch 'origin/dbus-1.8'
Ralf Habacker [Wed, 6 May 2015 10:14:31 +0000 (12:14 +0200)]
Merge remote-tracking branch 'origin/dbus-1.8'

9 years agoreader_init: Initialize all fields of struct DBusTypeReader (CID 54754, 54772, 54773).
Ralf Habacker [Wed, 6 May 2015 10:09:19 +0000 (12:09 +0200)]
reader_init: Initialize all fields of struct DBusTypeReader (CID 54754, 54772, 54773).

This patch is based on the fix for 'Field reader.array_len_offset is uninitialized'

Reported by Coverity: CID 54754, 54772, 54773: Uninitialized scalar variable (UNINIT)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodo_check_nonce: Fix of calling _dbus_string_append_len without checking return value...
Ralf Habacker [Wed, 6 May 2015 07:18:20 +0000 (09:18 +0200)]
do_check_nonce: Fix of calling _dbus_string_append_len without checking return value (CID 54720).

Reported by Coverity: CID: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodbus_message_demarshal: Fix calling _dbus_string_append_len without checking return...
Ralf Habacker [Wed, 6 May 2015 06:25:20 +0000 (08:25 +0200)]
dbus_message_demarshal: Fix calling _dbus_string_append_len without checking return value (CID 54690).

Reported by Coverity: CID 54690: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoUpdate NEWS for 1.9 branch
Simon McVittie [Tue, 5 May 2015 11:50:20 +0000 (12:50 +0100)]
Update NEWS for 1.9 branch

9 years agoMerge branch 'dbus-1.8'
Simon McVittie [Tue, 5 May 2015 11:50:11 +0000 (12:50 +0100)]
Merge branch 'dbus-1.8'

9 years agoNEWS for 1.8 branch
Simon McVittie [Tue, 5 May 2015 11:43:47 +0000 (12:43 +0100)]
NEWS for 1.8 branch

9 years agoDBusCounter: add a mutex to protect the refcount and notify function
Adrian Szyndela [Tue, 5 May 2015 11:30:30 +0000 (12:30 +0100)]
DBusCounter: add a mutex to protect the refcount and notify function

The overall problem here is that DBusCounter is indirectly linked
to a DBusConnection, but is not actually guaranteed to be protected by
that connection's mutex; and a DBusMessage can carry a reference to the
DBusCounter, resulting in freeing that DBusMessage having an effect on
the DBusCounter.

Making the refcount atomic would not be a sufficient fix, since it would
not protect the notify function: _dbus_counter_notify() could be called
indirectly by dbus_message_unref(), in an arbitrary thread that does not
hold the DBusConnection's lock, at the same time that the holder
of the DBusConnection lock calls _dbus_transport_set_max_message_size().

[smcv: added commit message]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89297
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoextend lock's range in live_messages_notify()
Adrian Szyndela [Tue, 5 May 2015 11:27:15 +0000 (12:27 +0100)]
extend lock's range in live_messages_notify()

The other code paths that ref or unref a transport are protected by
the DBusConnection's lock. This function already used that lock,
but for a narrower scope than the refcount manipulation.

live_messages_notify() could be triggered by unreffing messages
that originated from the same connection in a different thread.

[smcv: added commit message]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90312
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agotools: MSVC compile fixes
Ralf Habacker [Tue, 28 Apr 2015 18:11:27 +0000 (20:11 +0200)]
tools: MSVC compile fixes

unistd.h and sleep() are normally Unix-specific, although mingw also provides them.
The Windows C runtime documents _environ as its equivalent of Unix environ.

https://bugs.freedesktop.org/show_bug.cgi?id=90089
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMerge remote-tracking branch 'origin/dbus-1.8'
Ralf Habacker [Fri, 1 May 2015 21:08:43 +0000 (23:08 +0200)]
Merge remote-tracking branch 'origin/dbus-1.8'

Conflicts:
cmake/test/CMakeLists.txt
test/Makefile.am

9 years agotest_command_line_internal: Fix variable original_argv going out of scope leaks the...
Ralf Habacker [Tue, 21 Apr 2015 12:14:26 +0000 (14:14 +0200)]
test_command_line_internal: Fix variable original_argv going out of scope leaks the storage it points to (CID 60588).

Reported by Coverity: CID 60588: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agotest_remove_directory: Fix 'variable iter going out of scope leaks the storage it...
Ralf Habacker [Mon, 20 Apr 2015 20:14:06 +0000 (22:14 +0200)]
test_remove_directory: Fix 'variable iter going out of scope leaks the storage it points to' (CID 54729)

Reported by Coverity: CID 54729: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agotest_command_line_internal: Fix 'variable shell_argv going out of scope leaks the...
Ralf Habacker [Mon, 20 Apr 2015 19:55:27 +0000 (21:55 +0200)]
test_command_line_internal: Fix 'variable shell_argv going out of scope leaks the storage it points to' (CID 54751)

Reported by Coverity: CID 54751: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodbus_test_tool_spam: Fix 'variable payload going out of scope leaks the storage it...
Ralf Habacker [Mon, 20 Apr 2015 19:47:21 +0000 (21:47 +0200)]
dbus_test_tool_spam: Fix 'variable payload going out of scope leaks the storage it points to' (CID 54759)

Reported by Coverity: CID 54759: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodbus_test_tool_spam: Fix 'variable random_sizes going out of scope leaks the storage...
Ralf Habacker [Mon, 20 Apr 2015 19:40:14 +0000 (21:40 +0200)]
dbus_test_tool_spam: Fix 'variable random_sizes going out of scope leaks the storage it points to' (CID 54761)

Reported by Coverity: CID 54761: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodbus_server_set_auth_mechanisms: Fix returning without unlocking server->mutex->lock...
Ralf Habacker [Wed, 22 Apr 2015 12:47:08 +0000 (14:47 +0200)]
dbus_server_set_auth_mechanisms: Fix returning without unlocking server->mutex->lock (CID 54749).

Reported by Coverity: CID 54749: Missing unlock (LOCK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: Give users a hint to run autogen.sh if config.h.in is not present to see autot...
Ralf Habacker [Thu, 5 Mar 2015 19:48:09 +0000 (20:48 +0100)]
cmake: Give users a hint to run autogen.sh if config.h.in is not present to see autotools config header differences.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix msvc sign-compare warning on Windows7 64bit by adding a type cast.
Ralf Habacker [Mon, 20 Apr 2015 10:35:53 +0000 (12:35 +0200)]
Fix msvc sign-compare warning on Windows7 64bit by adding a type cast.

The related warning is: C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90089
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: Add msvc support for sign-compare warnings.
Ralf Habacker [Sat, 18 Apr 2015 19:54:05 +0000 (21:54 +0200)]
cmake: Add msvc support for sign-compare warnings.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90089
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: Dump missing config header checks only if config.h.in is present.
Ralf Habacker [Sat, 18 Apr 2015 19:14:11 +0000 (21:14 +0200)]
cmake: Dump missing config header checks only if config.h.in is present.

config.h.in is only generated by running autogen.sh.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90089
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAlways assert that BUS_CONNECTION_DATA() returns non-NULL
Ralf Habacker [Tue, 14 Apr 2015 21:17:40 +0000 (23:17 +0200)]
Always assert that BUS_CONNECTION_DATA() returns non-NULL

Every DBusConnection in the dbus-daemon should have been through
bus_connections_setup_connection(), so we can assert that the
BusConnectionData has been attached to it. Having this assertion
is enough to hint to Coverity that it does not need to worry about
whether this pointer might be NULL.

In regression tests, we do work with a few fake client-side
DBusConnection instances in the same process; but it would be a
serious bug if we mixed those up with the ones processed by
dbus-daemon's real code, so the assertion is still valid.

This patch has been inspired by (and fixes) the following coverity scan issues:
CID 54846: Dereference null return value (NULL_RETURNS).
CID 54854: Dereference null return value (NULL_RETURNS).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: fixed -Wdeclaration-after-statement; more informative commit message]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoinclude_dir: skip processing on error (CID 54744)
Ralf Habacker [Tue, 14 Apr 2015 21:48:23 +0000 (23:48 +0200)]
include_dir: skip processing on error (CID 54744)

We already skipped processing for DBUS_ERROR_FILE_NOT_FOUND;
but if the error was something else, we would pass the NULL
pointer dir to _dbus_directory_get_next_file(), which dereferences it.
Reported by Coverity: CID 54744: Dereference after null check (FORWARD_NULL)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
[smcv: re-worded commit message]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMove Autoconf/Automake droppings into /build-aux/
Simon McVittie [Wed, 4 Mar 2015 10:37:49 +0000 (10:37 +0000)]
Move Autoconf/Automake droppings into /build-aux/

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoRun name-test tests under the TAP driver
Simon McVittie [Wed, 1 Apr 2015 12:27:46 +0000 (13:27 +0100)]
Run name-test tests under the TAP driver

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoname-test: remove unused die function
Simon McVittie [Wed, 1 Apr 2015 12:27:06 +0000 (13:27 +0100)]
name-test: remove unused die function

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoRun most tests under the TAP driver, with a simple adaptor for non-TAP tests
Simon McVittie [Mon, 2 Mar 2015 12:36:16 +0000 (12:36 +0000)]
Run most tests under the TAP driver, with a simple adaptor for non-TAP tests

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agodbus-run-session(1): document modern Automake syntax
Simon McVittie [Wed, 1 Apr 2015 12:10:37 +0000 (13:10 +0100)]
dbus-run-session(1): document modern Automake syntax

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoname-test: also switch to AM_TESTS_ENVIRONMENT here
Simon McVittie [Wed, 1 Apr 2015 12:07:36 +0000 (13:07 +0100)]
name-test: also switch to AM_TESTS_ENVIRONMENT here

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoChange syntax of AM_TESTS_ENVIRONMENT to what the Automake docs prefer
Simon McVittie [Wed, 1 Apr 2015 12:07:19 +0000 (13:07 +0100)]
Change syntax of AM_TESTS_ENVIRONMENT to what the Automake docs prefer

On closer inspection of Automake docs, this is how AM_TESTS_ENVIRONMENT
is actually meant to work; the parallel test driver is even less
compatible with the old serial test driver than I'd realised :-(

Also, according to <http://www.unix.com/man-page/POSIX/1posix/export>,
"export FOO=bar" is actually required functionality for POSIX shells,
and is not a bashism. The Autoconf documentation mentions Solaris 10
as an example of somewhere this doesn't work... but at this point
I'd prefer to say "compiling dbus requires a POSIX shell".

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoDepend on Automake 1.13 so we can use the correct AM_TESTS_ENVIRONMENT
Simon McVittie [Mon, 2 Mar 2015 11:46:13 +0000 (11:46 +0000)]
Depend on Automake 1.13 so we can use the correct AM_TESTS_ENVIRONMENT

Since Automake 1.13 (released December 2012) the correct way for a
maintainer to specify environment variables has been
AM_TESTS_ENVIRONMENT, with TESTS_ENVIRONMENT reserved for the user.
That doesn't work in older Automake, so drop support for such old
versions.

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoinstalled-tests: don't set DBUS_TEST_HOME which is misleading
Simon McVittie [Thu, 26 Feb 2015 17:55:45 +0000 (17:55 +0000)]
installed-tests: don't set DBUS_TEST_HOME which is misleading

It doesn't do anything - the variable I was thinking of is called
DBUS_TEST_HOMEDIR. Also, if I had spelled it correctly, the tests
would have failed, because libdbus (quite reasonably) won't create
a nonexistent $HOME to write out cookie_sha1 files in ~/.dbus_keyrings.

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoinstalled-tests: declare that the output is in TAP format
Simon McVittie [Thu, 26 Feb 2015 17:53:46 +0000 (17:53 +0000)]
installed-tests: declare that the output is in TAP format

For the ones written using GLib, the output is in TAP format if we
say --tap. For the one not written using GLib, the output is in TAP
and the command-line is ignored.

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agotest-shell, test-printf: produce TAP output like the other installable tests
Simon McVittie [Thu, 26 Feb 2015 17:39:20 +0000 (17:39 +0000)]
test-shell, test-printf: produce TAP output like the other installable tests

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agotests: provide g_test_skip() emulation for older GLib
Simon McVittie [Thu, 26 Feb 2015 17:11:19 +0000 (17:11 +0000)]
tests: provide g_test_skip() emulation for older GLib

We don't hard-depend on a new enough GLib to have g_test_skip();
if our GLib is older, fake it using g_test_message() and degrade to
reporting it as a pass rather than a skip.

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agotests: avoid noise on stdout when not --verbose
Simon McVittie [Thu, 26 Feb 2015 17:12:22 +0000 (17:12 +0000)]
tests: avoid noise on stdout when not --verbose

This makes life easier for frameworks like LAVA that screen-scrape
test results.

g_test_message() is not displayed by default, but each test can be run
with either --tap or --verbose to get these messages displayed.

Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846

9 years agoAdd manual tcp test case.
Ralf Habacker [Wed, 28 Jan 2015 21:44:16 +0000 (22:44 +0100)]
Add manual tcp test case.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
(cherry picked from commit fa1ada44eabd62b46b89c7be22bfce6d595d8dac)

Conflicts:
cmake/test/CMakeLists.txt
test/Makefile.am

9 years agoCID 54766: Resource leak (RESOURCE_LEAK).
Ralf Habacker [Tue, 14 Apr 2015 08:01:49 +0000 (10:01 +0200)]
CID 54766: Resource leak (RESOURCE_LEAK).

Variable original_argv going out of scope leaks the storage it points to.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMerge branch 'dbus-1.8'
Ralf Habacker [Mon, 13 Apr 2015 13:36:21 +0000 (15:36 +0200)]
Merge branch 'dbus-1.8'

Conflicts:
dbus/dbus-sysdeps-win.c

9 years agoFix 'dbus connection referencing issue in test-relay'.
Ralf Habacker [Mon, 13 Apr 2015 13:04:20 +0000 (15:04 +0200)]
Fix 'dbus connection referencing issue in test-relay'.

The watches added on connection setup should be removed on shutdown.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90005
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAdd newline to verbose output in _dbus_trace_ref().
Ralf Habacker [Fri, 10 Apr 2015 10:38:59 +0000 (12:38 +0200)]
Add newline to verbose output in _dbus_trace_ref().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90004
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: Extend underlines below dbus version print on configure summary title.
Ralf Habacker [Tue, 24 Mar 2015 07:03:54 +0000 (08:03 +0100)]
cmake: Extend underlines below dbus version print on configure summary title.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoFix assorted compiler warnings on Windows.
Simon McVittie [Thu, 12 Mar 2015 19:03:12 +0000 (19:03 +0000)]
Fix assorted compiler warnings on Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[rh: rebased because a few hunks have already been applied with commit
 92c39d1d8a30110c5760bd8d5e695e26a8538d1a]

9 years agoRename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair().
Ralf Habacker [Fri, 6 Mar 2015 07:09:57 +0000 (08:09 +0100)]
Rename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: only set CMP0053, CMP0054 on CMake >= 3.1
Simon McVittie [Thu, 12 Mar 2015 14:58:19 +0000 (14:58 +0000)]
cmake: only set CMP0053, CMP0054 on CMake >= 3.1

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoFix of 'warning: variable ‘..‘ set but not used [-Wunused-but-set-variable]'.
Ralf Habacker [Wed, 4 Mar 2015 07:19:59 +0000 (08:19 +0100)]
Fix of 'warning: variable ‘..‘ set but not used [-Wunused-but-set-variable]'.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoRevert "Rename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair()."
Ralf Habacker [Wed, 11 Mar 2015 14:56:58 +0000 (15:56 +0100)]
Revert "Rename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair()."

This reverts commit ee0e15366c8b1ea196ad63a8376c8b5299279386.

9 years agoRevert "Use typedef DBusSocket for sockets fd's to avoid conversion warnings."
Ralf Habacker [Wed, 11 Mar 2015 14:41:55 +0000 (15:41 +0100)]
Revert "Use typedef DBusSocket for sockets fd's to avoid conversion warnings."

This reverts commit f9192688b6758d20e955adeb255399b79ba43a95.

9 years agocmake: opt-in to not implicitly expanding variables in if() (policy CMP0054)
Ralf Habacker [Wed, 11 Mar 2015 14:41:24 +0000 (15:41 +0100)]
cmake: opt-in to not implicitly expanding variables in if() (policy CMP0054)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoRevert "cmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE...
Ralf Habacker [Wed, 11 Mar 2015 14:40:10 +0000 (15:40 +0100)]
Revert "cmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead (policy CMP0053)"

This reverts commit 45f2e84a7de52f55fc1b41fefbc1b71a40d7a4eb.

9 years agoUse typedef DBusSocket for sockets fd's to avoid conversion warnings.
Ralf Habacker [Thu, 5 Mar 2015 18:50:12 +0000 (19:50 +0100)]
Use typedef DBusSocket for sockets fd's to avoid conversion warnings.

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

9 years agoRename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair().
Ralf Habacker [Fri, 6 Mar 2015 07:09:57 +0000 (08:09 +0100)]
Rename _dbus_full_duplex_pipe() to more descriptive name _dbus_socketpair().

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

9 years agocmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead...
Ralf Habacker [Thu, 5 Mar 2015 23:04:14 +0000 (00:04 +0100)]
cmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead (policy CMP0053)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead...
Ralf Habacker [Thu, 5 Mar 2015 22:57:50 +0000 (23:57 +0100)]
cmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead (policy CMP0053)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agocmake: stop using deprecated LOCATION property (policy CMP0026)
Ralf Habacker [Thu, 5 Mar 2015 22:44:44 +0000 (23:44 +0100)]
cmake: stop using deprecated LOCATION property (policy CMP0026)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix cmake build system bug not generating versioned library name in case LT_REVISION...
Ralf Habacker [Fri, 20 Feb 2015 18:04:42 +0000 (19:04 +0100)]
Fix cmake build system bug not generating versioned library name in case LT_REVISION is zero.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAdd missing include file for cmake function check_include_files() (commit 2d2b5af)
Ralf Habacker [Thu, 5 Mar 2015 13:43:26 +0000 (14:43 +0100)]
Add missing include file for cmake function check_include_files() (commit 2d2b5af)

9 years agodbus-print-message: conditionalize Unix FD handling on DBUS_UNIX
Simon McVittie [Wed, 4 Mar 2015 12:11:20 +0000 (12:11 +0000)]
dbus-print-message: conditionalize Unix FD handling on DBUS_UNIX

We close() the fd after we have printed it, but close() isn't
standard functionality on Windows. Unix FD-passing is never going
to work on non-Unix platforms anyway.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89428
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agodbus-monitor: use _dbus_get_real_time instead of gettimeofday
Simon McVittie [Wed, 4 Mar 2015 12:10:17 +0000 (12:10 +0000)]
dbus-monitor: use _dbus_get_real_time instead of gettimeofday

gettimeofday is implicitly declared (i.e. not in our #include'd header
files) when cross-compiling for on Windows. Now that fd.o#83115
has been fixed, using _dbus functions is not a problem.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89428
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoImprove diagnostics when UpdateActivationEnvironment calls are rejected
Simon McVittie [Thu, 5 Mar 2015 12:32:05 +0000 (12:32 +0000)]
Improve diagnostics when UpdateActivationEnvironment calls are rejected

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88812
Reviewed-by: Colin Walters <walters@verbum.org>
[smcv: rebased to not require the extra code initially on that bug]

9 years agoKeep cmake generated defines for include files in sync with autotools.
Ralf Habacker [Thu, 5 Mar 2015 12:07:55 +0000 (13:07 +0100)]
Keep cmake generated defines for include files in sync with autotools.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMove include file checks to ConfigureChecks.cmake for cmake build system.
Ralf Habacker [Thu, 5 Mar 2015 12:06:10 +0000 (13:06 +0100)]
Move include file checks to ConfigureChecks.cmake for cmake build system.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAdd check to cmake build system if config.h.cmake is in sync with autotools.
Ralf Habacker [Thu, 5 Mar 2015 12:03:47 +0000 (13:03 +0100)]
Add check to cmake build system if config.h.cmake is in sync with autotools.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoKeep include file checks in sync with autotools.
Ralf Habacker [Thu, 5 Mar 2015 08:02:03 +0000 (09:02 +0100)]
Keep include file checks in sync with autotools.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAdd cmake macro autoheaderchecks().
Ralf Habacker [Thu, 5 Mar 2015 08:01:31 +0000 (09:01 +0100)]
Add cmake macro autoheaderchecks().

This macro prints out any include file defined as HAVE_..._H in the config
header template and not in the related cmake configure checks file.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix broken cmake HAVE_SOCKLEN_T type finding check.
Ralf Habacker [Wed, 4 Mar 2015 13:10:17 +0000 (14:10 +0100)]
Fix broken cmake HAVE_SOCKLEN_T type finding check.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoAdd missing header for _dbus_sleep_milliseconds() (commit 43d2455)
Simon McVittie [Wed, 4 Mar 2015 18:47:52 +0000 (18:47 +0000)]
Add missing header for _dbus_sleep_milliseconds() (commit 43d2455)

9 years agoAdd test-fdpass to cmake build system.
Ralf Habacker [Wed, 4 Mar 2015 18:14:03 +0000 (19:14 +0100)]
Add test-fdpass to cmake build system.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agosignal_handler: avoid signed/unsigned mismatch (-Wsign-compare)
Simon McVittie [Wed, 4 Mar 2015 11:52:51 +0000 (11:52 +0000)]
signal_handler: avoid signed/unsigned mismatch (-Wsign-compare)

We're ignoring the result of this write() to stderr anyway, because
if it failed... what would we do? Write to stderr? That wouldn't work
any better the second time :-)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoEnable -Wsign-compare for cmake builds.
Ralf Habacker [Wed, 4 Mar 2015 09:18:08 +0000 (10:18 +0100)]
Enable -Wsign-compare for cmake builds.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoAutotools: enable -Wsign-compare and optionally -Werror=sign-compare
Simon McVittie [Wed, 4 Mar 2015 10:41:47 +0000 (10:41 +0000)]
Autotools: enable -Wsign-compare and optionally -Werror=sign-compare

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agofd-passing test: numbers of things are unsigned (-Wsign-compare)
Simon McVittie [Wed, 4 Mar 2015 11:29:41 +0000 (11:29 +0000)]
fd-passing test: numbers of things are unsigned (-Wsign-compare)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years ago_dbus_listen_systemd_sockets: fds are signed ints (-Wsign-compare)
Simon McVittie [Wed, 4 Mar 2015 11:05:50 +0000 (11:05 +0000)]
_dbus_listen_systemd_sockets: fds are signed ints (-Wsign-compare)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoUse new _dbus_string_get_length_uint() to avoid another -Wsign-compare
Simon McVittie [Wed, 4 Mar 2015 11:58:45 +0000 (11:58 +0000)]
Use new _dbus_string_get_length_uint() to avoid another -Wsign-compare

DBusString's length is signed for historical reasons: the right type
would have been size_t or some other unsigned type. We have a *lot*
of callers of _dbus_string_get_length(), so it is not really desirable
to do a flag-day switch; but we know that the length is always in the
range [0, INT_MAX] that is common to int and unsigned int, so we can
safely add an unsigned accessor.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoDrop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead.
Ralf Habacker [Wed, 4 Mar 2015 10:49:54 +0000 (11:49 +0100)]
Drop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix warning 'conversion to ‘long unsigned int’ from ‘WriteResult’ may change the...
Ralf Habacker [Tue, 3 Mar 2015 13:15:51 +0000 (14:15 +0100)]
Fix warning 'conversion to ‘long unsigned int’ from ‘WriteResult’ may change the sign of the result [-Wsign-conversion]'.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix of 'warning: conversion to ‘dbus_bool_t‘ from ‘int‘ may change the sign of the...
Ralf Habacker [Wed, 4 Mar 2015 07:28:09 +0000 (08:28 +0100)]
Fix of 'warning: conversion to ‘dbus_bool_t‘ from ‘int‘ may change the sign of the result [-Wsign-conversion]'.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix of 'warning: unused variable ‘result‘ [-Wunused-variable]'.
Ralf Habacker [Wed, 4 Mar 2015 07:17:15 +0000 (08:17 +0100)]
Fix of 'warning: unused variable ‘result‘ [-Wunused-variable]'.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix warning: conversion to 'DWORD' from 'int' may change the sign of the result ...
Ralf Habacker [Tue, 3 Mar 2015 16:16:51 +0000 (17:16 +0100)]
Fix warning: conversion to 'DWORD' from 'int' may change the sign of the result [-Wsign-conversion].

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoTrivial -Wsign-compare fixes.
Ralf Habacker [Tue, 3 Mar 2015 20:26:31 +0000 (21:26 +0100)]
Trivial -Wsign-compare fixes.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agobelatedly bump version for 1.9.15
Simon McVittie [Wed, 4 Mar 2015 10:38:36 +0000 (10:38 +0000)]
belatedly bump version for 1.9.15

9 years agoMake all time values signed longs instead of a mix of signed and unsigned, to avoid...
Peter McCurdy [Tue, 3 Mar 2015 19:52:36 +0000 (20:52 +0100)]
Make all time values signed longs instead of a mix of signed and unsigned, to avoid compiler complaints.

check_timeout() tries to use some unsigned long variables to
perform some intermediate calculations, then has to cast
back to signed long. As it happens, there's no real chance
of overflowing a signed long (it'll only happen if the current
time is within 49.7 days of rolling over, at which point you're
already pretty doomed), so we can make the calculations a bit
simpler, and also avoid the mixed-signedness arithmetic we'd
otherwise need to do.

Bug: https://bugs.freedesktop.org/attachment.cgi?id=18494
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoKeep cmake defines GLIB_VERSION_... in sync with autotools.
Ralf Habacker [Tue, 3 Mar 2015 12:17:27 +0000 (13:17 +0100)]
Keep cmake defines GLIB_VERSION_... in sync with autotools.

This patch adds autotools related cmake macros autoinit() and autodefine().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoprepare 1.9.14
Simon McVittie [Mon, 2 Mar 2015 14:48:25 +0000 (14:48 +0000)]
prepare 1.9.14

9 years agoFix warning: 'the comparison will always evaluate as 'false' for the address of ...
Ralf Habacker [Wed, 25 Feb 2015 09:36:03 +0000 (10:36 +0100)]
Fix warning: 'the comparison will always evaluate as 'false' for the address of '....' will never be NULL [-Waddress]'

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoMake include_dir non-existing directory, to not be an error.
Dimitri John Ledkov [Wed, 25 Feb 2015 14:10:47 +0000 (14:10 +0000)]
Make include_dir non-existing directory, to not be an error.

Empty include directories were already not treated as failures.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89280
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoNEWS
Simon McVittie [Tue, 24 Feb 2015 17:02:22 +0000 (17:02 +0000)]
NEWS

9 years agomonitor test: don't block in main context if we already have messages
Simon McVittie [Tue, 24 Feb 2015 15:25:34 +0000 (15:25 +0000)]
monitor test: don't block in main context if we already have messages

Functions like become_monitor() sometimes iterate the main context,
which could leave us with unprocessed messages in f->monitored.
We need to drain that queue of unprocessed messages (setting flags
accordingly, which might meet the loop's exit condition or cause
a break) before we are willing to block in the main context again.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89222
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
9 years agotest_init: convert SIGALRM into SIGABRT so we leave a core dump on timeout
Simon McVittie [Fri, 20 Feb 2015 16:01:09 +0000 (16:01 +0000)]
test_init: convert SIGALRM into SIGABRT so we leave a core dump on timeout

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89222
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
9 years agoNEWS
Simon McVittie [Tue, 24 Feb 2015 13:43:17 +0000 (13:43 +0000)]
NEWS

9 years agodbus-monitor: Keep term 'dest' in --monitor output in sync with related watch expression.
Ralf Habacker [Tue, 17 Feb 2015 07:26:54 +0000 (08:26 +0100)]
dbus-monitor: Keep term 'dest' in --monitor output in sync with related watch expression.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88896
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: rebase onto differently indented version of previous commit]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agodbus-monitor: Add timestamp to --monitor mode.
Ralf Habacker [Mon, 23 Feb 2015 21:00:46 +0000 (22:00 +0100)]
dbus-monitor: Add timestamp to --monitor mode.

Use cross platform function _dbus_get_real_time() for fetching current time.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88896
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: use %ld to avoid needing casts; reinstate printing the timestamp;
libdbus-1 is sufficient now that fd.o#83115 is fixed; print timestamp for
non-literal dbus-send replies too]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agodbus-monitor: Keep parameter list of method returns in --monitor mode in sync with...
Ralf Habacker [Tue, 17 Feb 2015 07:38:44 +0000 (08:38 +0100)]
dbus-monitor: Keep parameter list of method returns in --monitor mode in sync with --profile mode.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88896
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agodbus-monitor: convert remaining hard tabs to 8 space.
Ralf Habacker [Tue, 17 Feb 2015 07:17:00 +0000 (08:17 +0100)]
dbus-monitor: convert remaining hard tabs to 8 space.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88896
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoActually commit cmake changes for dbus-launch
Simon McVittie [Tue, 24 Feb 2015 11:42:54 +0000 (11:42 +0000)]
Actually commit cmake changes for dbus-launch

9 years agodbus-launch: if autolaunching, use XDG_RUNTIME_DIR/bus if available
Simon McVittie [Fri, 20 Feb 2015 22:14:48 +0000 (22:14 +0000)]
dbus-launch: if autolaunching, use XDG_RUNTIME_DIR/bus if available

This provides backwards-compatible autolaunching behaviour, as long
as dbus-launch inherits the XDG_RUNTIME_DIR (which it presumably did
if it's going to work at all, since it must also have inherited the
DISPLAY). In particular, we go through the motions of starting the
dbus-daemon, so that we can start the "babysitter" process that will
maintain the X11 window to store the bus address.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
[smcv: decorate _dbus_lookup_user_bus with DBUS_PRIVATE_EXPORT so we
can still call it after fixing fd.o#83115; update cmake to match Autotools]