Commit graph

4474 commits

Author SHA1 Message Date
Simon McVittie
0cfe2cfb4e autogen.sh: fail cleanly if autoconf fails
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
(cherry picked from commit 0bbfca6def)
2016-10-03 11:42:42 +01:00
Simon McVittie
0ffa8fd4e8 1.10.11 2016-08-15 23:31:18 +01:00
Simon McVittie
640c5ad853 1.10.10
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-15 19:59:18 +01:00
Simon McVittie
c56cc26164 Add a regression test for dbus-launch in X11
[Modified for the dbus-1.10 branch: DBUS_USE_TEST_BINARY is needed.]

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 18:21:36 +01:00
Simon McVittie
6ce19c8625 test-dbus-daemon-fork: exercise closed stdin, stdout, stderr
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 18:21:36 +01:00
Simon McVittie
1679f58a14 test: expand dbus-launch-eval test to cover stdin being closed
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 18:21:36 +01:00
Simon McVittie
a7caca9f47 Add a simple test for dbus-daemon --fork
[Modified for the dbus-1.10 branch: DBUS_USE_TEST_BINARY is needed.]

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 18:21:32 +01:00
Simon McVittie
042391e88a test: add a regression test for eval "$(dbus-launch --sh-syntax)"
[Modified for the dbus-1.10 branch: DBUS_USE_TEST_BINARY is needed.]

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 18:21:01 +01:00
Simon McVittie
f518165b84 dbus-daemon, dbus-launch: cope with callers having closed standard fds
In Debian bug <https://bugs.debian.org/829348>, lightdm appears to
have been starting dbus-launch with at least one of the three
standard fds 0, 1, 2 (stdin, stdout, stderr) closed. This resulted
in the dbus-daemon's epoll_create1() returning a fd less than 3.
Later, _dbus_become_daemon() replaces fds 0-2 with /dev/null. As a
result, a subsequent call to _dbus_loop_add_watch() for the reload
pipe resulted in calling epoll_ctl on the non-epoll fd pointing to
/dev/null, which fails with EINVAL, resulting in the dbus-daemon
exiting unsuccessfully.

Unix programs are not normally expected to behave correctly when
launched with the standard fds not already open; but at the same time,
X11 autolaunching means that dbus-launch (and hence the dbus-daemon)
can get started from an arbitrarily precarious situation.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97008
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Thiago Macieira <thiago@kde.org>
(cherry picked from commit c8f73a2a3a)
2016-08-12 10:58:38 +01:00
Simon McVittie
ed33129fe4 _dbus_ensure_standard_fds: new function to ensure std* fds are open
This function opens stdin, stdout, stderr pointing to /dev/null
if they aren't already open. Optionally, it can also replace
whatever is available on those fds with /dev/null.

To allow for use in contexts where only async-signal-safe functions
should be used, such as between fork() and a following exec(),
this function does not use conventional libdbus error handling
(which would require malloc). Instead, it sets errno and returns
an explanatory string.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97008
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Thiago Macieira <thiago@kde.org>
(cherry picked from commit 69123a6bd2)
2016-08-12 10:58:38 +01:00
Simon McVittie
32c940d183 NEWS for 1.10 2016-08-12 10:12:28 +01:00
Simon McVittie
7ebe1de218 Mark WaitingForOK state as unused
It should probably be used (see #97298) but the fact that it isn't
is breaking compatibility with gcc 6, so apply a quick workaround
while we look into what's wrong here.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97282
(cherry picked from commit 21d6118081)
2016-08-12 10:11:31 +01:00
Simon McVittie
4729b7a5f4 update-activation-environment: produce better diagnostics on error
If dbus-daemon or systemd replied to our method call with an error,
we would report it as "invalid arguments" instead of the true error
name and message.

Same root cause as <https://bugs.freedesktop.org/show_bug.cgi?id=96653>.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-12 09:50:00 +01:00
Simon McVittie
9e79a8ff8c NEWS for 1.10 branch 2016-07-29 19:14:18 +01:00
Ioan-Adrian Ratiu
1bfde22292 configure.ac: explicitely check stdint.h
Otherwise HAVE_STDINT_H will not be defined or the var will not be
picked up from cache so builds could fail with errors like:
| ../../dbus-1.10.8/dbus/dbus-internals.h:239:8: error: ‘uintptr_t’ undeclared (first use in this function)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
[smcv: fix Autoconf underquoting]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-07-29 19:12:59 +01:00
Simon McVittie
bed2688452 Update NEWS for merge of dbus-1.10-ci branch 2016-07-25 11:53:13 +01:00
Simon McVittie
8dab754686 Merge branch 'dbus-1.10-ci' into dbus-1.10 2016-07-25 11:43:54 +01:00
Simon McVittie
2a5dccf0ab Update NEWS 2016-06-30 14:40:24 +01:00
Simon McVittie
b5bef9dc16 Merge branch 'dbus-1.10' into dbus-1.10-ci 2016-06-30 13:57:29 +01:00
WaLyong Cho
2fe59f1892 activation: set children oom_score_adj to 0
If dbus is running as systemd service, dbus daemon is running with
oom_score_adj -900 by OOMScoreAdjust=-900. And children will also have
same value with dbus daemon.
To avoid this, set the child itself values after fork () to 0.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32851
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-06-30 13:54:10 +01:00
Руслан Ижбулатов
e0f26388f7 Use dbus_set_error_from_message() to check for an error
Do not rely on dbus_message_get_args() to turn an ERROR message
into DBusError.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=96653
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-06-30 13:52:44 +01:00
Thiago Macieira
07af048dd2 Quote the DBUS_SESSION_BUS_ADDRESS variable in the shell file
Some D-Bus daemon versions set multiple addresses separated by semi-colon,
which breaks sourcing of the file.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94746
Signed-off-by: Thiago Macieira <thiago@kde.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-06-30 13:51:45 +01:00
Simon McVittie
727c5429ba travis: compile with mingw in both production and debug flavours
This should detect anything that is only a build failure when embedded
tests or verbose mode are enabled, such as the missing include fixed
in commit 4858faf. I'm not enabling embedded tests and verbose mode
orthogonally because we don't want CI builds to take too long.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 8f6fe1451e)
2016-05-18 18:14:29 +01:00
Simon McVittie
5602ef4bf2 Merge branch 'dbus-1.10' into dbus-1.10-ci 2016-05-18 18:14:16 +01:00
Simon McVittie
78362cfc62 test-segfault: add missing include of <stdio.h> on Windows
Needed for fprintf (stderr, ...).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 07b7dcd717)
2016-05-18 18:13:48 +01:00
Ralf Habacker
7bcaf35bca Fix ambiguous setup of DBusBabySitter struct member child_handle on Windows.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-05-16 12:52:25 +02:00
Ralf Habacker
baeea825a4 On Windows make access to member 'refcount' of struct DBusBabysitter thread safe.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-05-13 13:39:30 +02:00
Ralf Habacker
a5c51278ad Eliminates a race condition accessing DBusBabysitter instance at startup of babysitter() on Windows.
Ensure that the babysitter thread already owns its one reference to the
babysitter when it starts up, and eliminates the race condition.
This patch requires that DBusBabysitter refcounting is thread-safe
and is based on an analysis and proposal of Simon Mc Vittie.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-05-13 13:39:19 +02:00
Ralf Habacker
5ef167c139 Suppress Windows popups and jit debugger when app crashes with exception.
Based on a patch from Yiyang Fei.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95155
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-05-09 21:49:22 +02:00
Yiyang Fei
cdf9fd02d2 Fix crash in test-spawn unit test app on Windows.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95160
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-04-29 19:23:35 +02:00
Ralf Habacker
eaf231b7db Fix assert in test-spawn caused by missing initialization of DBusError instance on gcc builds.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95160
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
(cherry picked from commit 9323a621e8)
2016-04-29 19:19:57 +02:00
Simon McVittie
aa44956ef6 Merge branch 'dbus-1.10' into dbus-1.10-ci 2016-03-07 19:45:15 +00:00
Simon McVittie
ffa99f343d 1.10.9 2016-03-07 19:31:52 +00:00
Simon McVittie
dc8f8c5294 1.10.8
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-03-07 16:07:20 +00:00
Simon McVittie
4b069c8a4c Disable travis-ci apt source for Google Chrome
This prevents adding i386 as a foreign architecture. We don't need
Chrome anyway.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-03-02 22:26:47 +00:00
Simon McVittie
735cf7b844 Merge branch 'dbus-1.10' into dbus-1.10-ci 2016-03-02 18:52:34 +00:00
Simon McVittie
42ccc7dc39 update NEWS 2016-03-02 18:24:11 +00:00
Dmitri Iouchtchenko
bfd9c8a3b3 dbus-test-tool echo: fix sleep documentation
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94244
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-03-02 18:19:35 +00:00
Simon McVittie
64d6dbd190 Statically assert that the DBusMessageIter struct has no padding
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136
2016-03-02 18:17:57 +00:00
Simon McVittie
38a5c3028e DBusMessageIter: eliminate padding on 64-bit platforms
Previously, 64-bit (LP64 or LLP64) platforms would have had 32 bits
of padding between pad2 and pad3. We want to guarantee that an ISO C
compiler will copy the entire struct when assigning between structs,
but padding is not guaranteed to be copied, so we want to ensure that
the struct is "packed".

Statically assert that the old ABI is compatible with the new ABI.

Reviewed-by: Thiago Macieira <thiago@kde.org>
[smcv: change >= to == as Thiago requested]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136
2016-03-02 18:16:26 +00:00
Simon McVittie
338cfa1599 DBusMessage: assert the properties we need DBusMessageIter to have
We already asserted that DBusMessageIter must be at least as large
as DBusMessageRealIter (so that casting DBusMessageIter * to
DBusMessageRealIter * does not result in overflowing the stack
variable). Also assert that it must have alignment requirements at
least as strict as those of DBusMessageRealIter * (so that casting
does not increase the required alignment).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136
2016-03-02 18:15:36 +00:00
Simon McVittie
ca9ea25e11 dbus-internals: add _DBUS_ALIGNOF
This is useful when making static assertions about our types'
properties.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136
2016-03-02 18:15:12 +00:00
Simon McVittie
9abba2d935 NEWS so far 2016-02-24 10:50:22 +00:00
Simon McVittie
d29534c075 Merge branch 'dbus-1.10' into dbus-1.10-ci 2016-02-12 15:32:38 +00:00
Simon McVittie
384c924c77 Revert "Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH"
This reverts commit 8fd2be6013.
This change was intended for 1.11.
2016-02-12 15:25:15 +00:00
Simon McVittie
9843c724c6 Revert "name-test C tests: produce structured (TAP) output"
This reverts commit fec99c9b3d.
This change was intended for 1.11.
2016-02-12 15:25:13 +00:00
Simon McVittie
c285a053d6 Revert "name-test: run most C tests directly, not via run-test.sh"
This reverts commit d893121efd.
This change was intended for 1.11.
2016-02-12 15:25:12 +00:00
Simon McVittie
1aa36b48cc Revert "Rename function string_array_length() to _dbus_string_array_length() and move it to dbus-internals.c."
This reverts commit 1370b44035.
This change was intended for 1.11.
2016-02-12 15:25:09 +00:00
Simon McVittie
554dba974c Revert "Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from related activation code."
This reverts commit 610ff8d964.
This change was intended for 1.11.
2016-02-12 15:24:55 +00:00
Ralf Habacker
610ff8d964 Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from related activation code.
These functions are required for dbus-run-session.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-02-11 23:43:09 +01:00