platform/upstream/dbus.git
11 years agoyet more NEWS
Simon McVittie [Wed, 9 Oct 2013 10:27:55 +0000 (11:27 +0100)]
yet more NEWS

11 years agodbus-monitor: keep backwards compatibility
Chengwei Yang [Wed, 9 Oct 2013 02:44:12 +0000 (10:44 +0800)]
dbus-monitor: keep backwards compatibility

eavesdropping as a match rule key introduced in DBus 1.5.6, and the
privous implementation doesn't keep backwards compatibility with older
dbus-daemon.

And the reference dbus-daemon implementation just fail if unknwon key
found in match rule, this is undefined hehavior in DBus Sepcification.

Also there is a feature request for change this hehavior to
"ignore unknown key in match rule", See
https://bugs.freedesktop.org/show_bug.cgi?id=66114

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agodbus-send: replace --address with --peer and --bus.
Andrey Mazo [Tue, 8 Oct 2013 14:54:11 +0000 (15:54 +0100)]
dbus-send: replace --address with --peer and --bus.

--peer is a direct substitute for --address.
With --bus dbus-send registers on bus given by ADDRESS, thus allowing
messages to be sent to the bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48816
[adjusted to apply to current master -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoRevert "dbus-send: replace --address"... to fix attribution
Simon McVittie [Wed, 9 Oct 2013 10:17:20 +0000 (11:17 +0100)]
Revert "dbus-send: replace --address"... to fix attribution

This reverts commit 5b74af796c8f1d9f3f60594f22c6bfd4c097ad8b.

11 years agoRemove unused key-word of DBus .service file
Chengwei Yang [Wed, 9 Oct 2013 02:06:52 +0000 (10:06 +0800)]
Remove unused key-word of DBus .service file

Key-word "Group" of DBus .service file hasn't been used since it was
introduced in 2007, so it's fine to remove it.

https://bugs.freedesktop.org/show_bug.cgi?id=19158
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agolaunch-helper: fix error code parsing
Chengwei Yang [Wed, 9 Oct 2013 00:50:37 +0000 (08:50 +0800)]
launch-helper: fix error code parsing

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66728
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoMerge branch 'dbus-1.6'
Simon McVittie [Tue, 8 Oct 2013 17:42:12 +0000 (18:42 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS
configure.ac

11 years ago1.6.17
Simon McVittie [Tue, 8 Oct 2013 16:33:56 +0000 (17:33 +0100)]
1.6.17

11 years agoSpec: document multiple .service files own the same well known name
Chengwei Yang [Tue, 8 Oct 2013 12:55:03 +0000 (20:55 +0800)]
Spec: document multiple .service files own the same well known name

In current dbus-daemon(1) implement, system .serivce must named after
its owned name, but this is not the case for session .service.

For session service, the result of multiple .service files own the
same well known name is undefined since readdir(3) doesn't return
dirent in a defined sequence.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66608
[added some </para><para> -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoUnify the way to find dbus-daemon test binary
Chengwei Yang [Tue, 8 Oct 2013 13:59:37 +0000 (21:59 +0800)]
Unify the way to find dbus-daemon test binary

There are two ways to find the dbus-daemon for testing. The first one is
defined as string at compile stage and the second one is export it from
test environment.

The first way has limitation that after defined, it's static string, so
it's impossible to run installable check. So let's unify to the second
way.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
[added missing "}" -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agodbus-send: replace --address with --peer and --bus.
Simon McVittie [Tue, 8 Oct 2013 14:54:11 +0000 (15:54 +0100)]
dbus-send: replace --address with --peer and --bus.

--peer is a direct substitute for --address.
With --bus dbus-send registers on bus given by ADDRESS, thus allowing
messages to be sent to the bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48816
[adjusted to apply to current master -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years ago1.6.14
Simon McVittie [Tue, 8 Oct 2013 12:26:17 +0000 (13:26 +0100)]
1.6.14

11 years agofix off by one error message (#13305)
Chengwei Yang [Sun, 29 Sep 2013 10:10:33 +0000 (18:10 +0800)]
fix off by one error message (#13305)

This patch is based on the patch created by John (J5) Palmieri
<johnp@redhat.com> plus to fix array of string assignment.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13305
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agodbus-message.c: unused variable bytes_read in _dbus_message_loader_get_buffer
Vasiliy Balyasnyy [Tue, 8 Oct 2013 09:36:38 +0000 (13:36 +0400)]
dbus-message.c: unused variable bytes_read in _dbus_message_loader_get_buffer

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70218
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agodbus-monitor: remove redundant match rules
Chengwei Yang [Wed, 26 Jun 2013 02:21:31 +0000 (10:21 +0800)]
dbus-monitor: remove redundant match rules

Currently, DBus Specification only consists of four message types, so to
monitor all the types of message, no need to match all of them but just
left it empty is OK.

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoNEWS
Simon McVittie [Tue, 8 Oct 2013 09:36:39 +0000 (10:36 +0100)]
NEWS

11 years agospec: briefly describe Name, Exec and User keys
Simon McVittie [Mon, 16 Sep 2013 13:36:21 +0000 (14:36 +0100)]
spec: briefly describe Name, Exec and User keys

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66608
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agospec: system services' service description files have constrained names
Simon McVittie [Mon, 16 Sep 2013 13:33:41 +0000 (14:33 +0100)]
spec: system services' service description files have constrained names

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66608
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agoDo not suggest user the next step after executed autogen.sh
Chengwei Yang [Tue, 24 Sep 2013 13:25:01 +0000 (21:25 +0800)]
Do not suggest user the next step after executed autogen.sh

We assume that user/developer who building dbus from source code are
familiar with the standard 'autogen.sh, configure, make, make install'
build process, so print such a notice doesn't make a lot of sense.

In addition, on *BSD platform, the pre-installed 'make' doesn't work at
all since gnu make is required. However, it named to 'gmake' on *BSD
platform. So the notice will makes new comer confused.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65415
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoAdd support for configuring --with-valgrind=auto
Simon McVittie [Fri, 12 Oct 2012 12:53:25 +0000 (13:53 +0100)]
Add support for configuring --with-valgrind=auto

This is the configuration I'd like to use for the "debug build" of dbus
on Debian - if we use --with-valgrind=yes, we have to hard-code knowledge
of which architectures do and don't have Valgrind in two places instead
of just one.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56925
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agoWhen using dbus-launch for tests, fail hard if test binary is missing
Simon McVittie [Mon, 16 Sep 2013 12:47:19 +0000 (13:47 +0100)]
When using dbus-launch for tests, fail hard if test binary is missing

We want to test the version-under-test, not the system version.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agodbus-launch: avoid asprintf(), and die gracefully on out-of-memory
Simon McVittie [Mon, 16 Sep 2013 12:40:22 +0000 (13:40 +0100)]
dbus-launch: avoid asprintf(), and die gracefully on out-of-memory

asprintf() is a GNU extension (non-portable).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agoFix build on NetBSD 6.1.1 with gcc 4.5.3
Chengwei Yang [Thu, 26 Sep 2013 09:35:36 +0000 (17:35 +0800)]
Fix build on NetBSD 6.1.1 with gcc 4.5.3

There are two build failure on NetBSD 6.1.1 with gcc 4.5.3, the first
one is char to int, warning treated as error. The second one is a mismatch
between format string and arguments.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69842
[adjusted commit message -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoNEWS
Simon McVittie [Wed, 25 Sep 2013 12:43:22 +0000 (13:43 +0100)]
NEWS

11 years agoUse 'cp' instead of 'cp -av' to fix portable issue
Chengwei Yang [Wed, 25 Sep 2013 06:17:21 +0000 (14:17 +0800)]
Use 'cp' instead of 'cp -av' to fix portable issue

Neither '-a' nor '-v' of 'cp' is available on OpenBSD 5.3, so use 'cp'
instead to fix portable issue.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69789
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoUse 'chmod' instead of 'chmod -c'
Chengwei Yang [Wed, 25 Sep 2013 06:09:19 +0000 (14:09 +0800)]
Use 'chmod' instead of 'chmod -c'

chmod -c is not available on *BSD system, and '-v' is not available on
OpenBSD, so just execute chmod without any option.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35881
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoNEWS
Simon McVittie [Mon, 23 Sep 2013 10:26:08 +0000 (11:26 +0100)]
NEWS

11 years ago_dbus_read_credentials_socket: warn or fail at compile time if no support
Simon McVittie [Fri, 13 Sep 2013 18:01:04 +0000 (19:01 +0100)]
_dbus_read_credentials_socket: warn or fail at compile time if no support

On a whitelist of OSs known to have working credentials-passing
(currently FreeBSD, Linux, OpenBSD and NetBSD), it would be a
regression for us to not have credentials-passing, so fail hard.

On other OSs, raise a warning, which is not normally fatal but
will alert developers on those platforms.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60340
Reviewed-by: Colin Walters <walters@verbum.org>
11 years agoPrefer getpeerucred() over getpeereid() if a platform has both
Simon McVittie [Fri, 13 Sep 2013 17:51:34 +0000 (18:51 +0100)]
Prefer getpeerucred() over getpeereid() if a platform has both

We want the process ID, and getpeerucred() provides that.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60340
Reviewed-by: Colin Walters <walters@verbum.org>
11 years agobus-test: only expect GetConnectionUnixProcessID to succeed sometimes
Simon McVittie [Fri, 13 Sep 2013 18:18:10 +0000 (19:18 +0100)]
bus-test: only expect GetConnectionUnixProcessID to succeed sometimes

On platforms that use getpeereid(), this can't work.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60340
Reviewed-by: Colin Walters <walters@verbum.org>
11 years ago_dbus_read_credentials_socket: document where we use each mechanism
Simon McVittie [Fri, 13 Sep 2013 17:50:40 +0000 (18:50 +0100)]
_dbus_read_credentials_socket: document where we use each mechanism

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60340
Reviewed-by: Colin Walters <walters@verbum.org>
11 years agoRemove BSD-style LOCAL_CREDS support
Simon McVittie [Fri, 13 Sep 2013 17:39:18 +0000 (18:39 +0100)]
Remove BSD-style LOCAL_CREDS support

It appears that this regressed back in 2009 (commit 7bf132c7)
and doesn't compile. Also, with patches from Matt Fischer to make
it compile again on QNX, it compiles but doesn't actually work
on NetBSD, which was the platform for which this code was added.
This might be for the reasons described in
<http://julipedia.meroh.net/2006/08/localcreds-socket-credentials.html>.
NetBSD pkgsrc has a large unsubmitted patch to use LOCAL_PEEREID, which
is analogous to Linux/OpenBSD SO_PEERCRED.

So, I think we can safely assume that nobody is relying on this:
either they implement one of our many other supported
credentials-passing mechanisms, or they're patching it locally
anyway.

LOCAL_CREDS is not actually very good - it's awkward to use, and
doesn't provide the pid, only the uid. Of the platforms known to
implement it, QNX and NetBSD both have getpeereid() which provides
just as much information, while FreeBSD and Dragonfly BSD both have
SCM_CREDS which provides the pid too. So, let's just get rid of it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60340
Reviewed-by: Colin Walters <walters@verbum.org>
11 years agoNEWS
Simon McVittie [Mon, 16 Sep 2013 14:30:13 +0000 (15:30 +0100)]
NEWS

11 years agoFix an incorrect sizeof.
Sviatoslav Chagaev [Mon, 16 Sep 2013 11:43:40 +0000 (12:43 +0100)]
Fix an incorrect sizeof.

Fix an incorrect sizeof which leads to allocation of more memory than
actually needed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329
[elide redundant "* sizeof (char)" which is 1 by definition -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoRevert "Fix an incorrect sizeof." to fix attribution
Simon McVittie [Mon, 16 Sep 2013 14:26:41 +0000 (15:26 +0100)]
Revert "Fix an incorrect sizeof." to fix attribution

This reverts commit 3c1938180bdca8fc658907f6f692186be2b81b77.

11 years agofix NEWS mis-merge
Simon McVittie [Mon, 16 Sep 2013 14:03:46 +0000 (15:03 +0100)]
fix NEWS mis-merge

11 years agoRemove support for platforms with no 64-bit integer type
Simon McVittie [Wed, 5 Jun 2013 18:43:13 +0000 (19:43 +0100)]
Remove support for platforms with no 64-bit integer type

This has been a soft requirement since 1.5.0; anyone on such platforms
would have had to configure --without-64-bit, provoking a warning that
instructed them to report a D-Bus bug with details of their platform.
Nobody has done so, so if anyone still lacks a 64-bit integer type,
they're on their own.

(Also, I tried the build with --without-64-bit and it's full of
fatal compiler warnings, so it's not clear that we're actually
losing anything by removing this "feature".)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65429
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agoMerge branch 'dbus-1.6'
Simon McVittie [Mon, 16 Sep 2013 13:59:01 +0000 (14:59 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

11 years agoNEWS for 1.6.x
Simon McVittie [Mon, 16 Sep 2013 13:58:24 +0000 (14:58 +0100)]
NEWS for 1.6.x

11 years agodbus-mainloop.c: undeclared variable n_fds if define MAINLOOP_SPEW.
Vasiliy Balyasnyy [Mon, 16 Sep 2013 11:14:33 +0000 (15:14 +0400)]
dbus-mainloop.c: undeclared variable n_fds if define MAINLOOP_SPEW.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69410
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoMerge branch 'dbus-1.6'
Simon McVittie [Mon, 16 Sep 2013 12:59:30 +0000 (13:59 +0100)]
Merge branch 'dbus-1.6'

11 years agodbus-sysdeps-unix.c: undeclared ret2 variable if HAVE_WRITEV undefined.
Vasiliy Balyasnyy [Mon, 16 Sep 2013 11:09:47 +0000 (15:09 +0400)]
dbus-sysdeps-unix.c: undeclared ret2 variable if HAVE_WRITEV undefined.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69409

11 years agoFix incorrect sizeof in a Valgrind hint macro call.
Sviatoslav Chagaev [Fri, 13 Sep 2013 15:43:41 +0000 (18:43 +0300)]
Fix incorrect sizeof in a Valgrind hint macro call.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69326
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoMerge branch 'dbus-1.6'
Simon McVittie [Mon, 16 Sep 2013 11:55:13 +0000 (12:55 +0100)]
Merge branch 'dbus-1.6'

11 years agoFix a NULL dereference on an error code path.
Sviatoslav Chagaev [Fri, 13 Sep 2013 15:54:27 +0000 (18:54 +0300)]
Fix a NULL dereference on an error code path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69327
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoFix an incorrect sizeof.
Simon McVittie [Mon, 16 Sep 2013 11:43:40 +0000 (12:43 +0100)]
Fix an incorrect sizeof.

Fix an incorrect sizeof which leads to allocation of more memory than
actually needed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329
[elide redundant "* sizeof (char)" which is 1 by definition -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agodbus-sysdeps-win: don't include wspiapi.h
Simon McVittie [Mon, 2 Sep 2013 16:39:37 +0000 (17:39 +0100)]
dbus-sysdeps-win: don't include wspiapi.h

This block provoked a warning on mingw-w64 because we were redefining
_inline. According to Ralf's research, it was introduced in 452ff68a:
Windows 2000 doesn't have getaddrinfo and related functions in
ws2tcpip.h, but does have a shim implementation in wspiapi.h.

At the time of 452ff68a, mingw32 didn't have wspiapi.h, so it's unclear
why there was a __GNUC__ code path here. The "#define _inline" on that
code path looks likely to be some sort of workaround for a faulty version
of wspiapi.h? Current mingw-w64 does have wspiapi.h, so we enter the
__GNUC__ code path and get the redefinition.

dbus no longer supports Windows 2000, so we no longer need wspiapi.h
at all, and can rely on XP or later. (Ralf's policy is to only support
versions of Windows that are still supported by Microsoft, and Windows 2000
reached the end of its life-cycle in 2010.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker
11 years agoMerge remote-tracking branch 'fitzsim/fix-parent-removal-fixme'
Simon McVittie [Fri, 13 Sep 2013 14:47:19 +0000 (15:47 +0100)]
Merge remote-tracking branch 'fitzsim/fix-parent-removal-fixme'

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60176

11 years agoNEWS
Simon McVittie [Fri, 13 Sep 2013 14:03:58 +0000 (15:03 +0100)]
NEWS

11 years agoMake userdb cache as a built-in feature
Chengwei Yang [Wed, 4 Sep 2013 07:13:33 +0000 (15:13 +0800)]
Make userdb cache as a built-in feature

The disable-userdb-cache code path is never been fine tested and you
could expect an extramely slow bus if you did that. And there are known
bugs on fd.o if build without userdb cache. So to prevent user from
using bus without userdb cache, it changed to a built-in feature, no
longer optional now.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66947
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=15589
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoDon't assume that X11 autolaunch will work if DISPLAY is unset
Simon McVittie [Fri, 13 Sep 2013 13:59:17 +0000 (14:59 +0100)]
Don't assume that X11 autolaunch will work if DISPLAY is unset

In practice, it won't; other forms of autolaunch (like Mac OS launchd)
might, but we can't really assert either way.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40352
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
[amended to reinstate use of dbus/dbus-sysdeps.h which was removed
by 412538b3b9 -smcv]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoUse test binaries in build dir to do test
Chengwei Yang [Fri, 13 Sep 2013 08:56:26 +0000 (16:56 +0800)]
Use test binaries in build dir to do test

When do autolaunch testing, libdbus will try to start dbus-launch in
installed direcotry, if fail then fall back to dbus-launch in $PATH.
dbus-launch does a relative better thing to start dbus-daemon in build
directory, however, in most of case, the build $prefix is different from
the real prefix where dbus-daemon installed. So dbus-daemon will fail to
start due to can't find its config file. And then dbus-launch will fall
back to finally the installed dbus-daemon.

This patch fix this behavior and will start dbus-launch and dbus-daemon
in build directory in test environment.

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

11 years agoselinux: when dropping capabilities only include AUDIT caps if we have them
Lennart Poettering [Sun, 22 Apr 2012 22:32:43 +0000 (00:32 +0200)]
selinux: when dropping capabilities only include AUDIT caps if we have them

When we drop capabilities we shouldn't assume we can keep
CAP_AUDIT_WRITE unconditionally, since it will not be available when
running in containers.

This patch only adds CAP_AUDIT_WRITE to the list of caps we keep if we
actually have it in the first place.

This makes audit/selinux enabled D-Bus work in a Linux container.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49062
Acked-by: Thiago Macieira <thiago@kde.org>
Acked-by: Colin Walters <walters@verbum.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoNEWS
Simon McVittie [Fri, 13 Sep 2013 13:16:50 +0000 (14:16 +0100)]
NEWS

11 years agoRemove obscure "low-latency" parts in the introduction of spec
Justin Lee [Wed, 29 May 2013 19:21:31 +0000 (03:21 +0800)]
Remove obscure "low-latency" parts in the introduction of spec

According to Wikipedia
http://en.wikipedia.org/wiki/Latency_%28engineering%29#Packet-switched_networks
latency means "the time from the source sending a packet to the destination
receiving it". Therefore, latency is unrelated to whether the operation is
asynchronous or synchronous. And also unrelated to whether it's one-way or
round-trip. Latency exists for asynchronous and one-way transfer, because for
current DBus implementations we need at least one context switch to transfer
each message from the sender process to the receiver process. Emphasizing
D-Bus is low-latency could encourage user to abuse/misuse the system.

Mail disscusion:
http://lists.freedesktop.org/archives/dbus/2013-May/015665.html

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65141
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoMore NEWS
Simon McVittie [Fri, 13 Sep 2013 13:06:02 +0000 (14:06 +0100)]
More NEWS

11 years agoMerge branch 'dbus-1.6'
Simon McVittie [Fri, 13 Sep 2013 13:04:45 +0000 (14:04 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS
configure.ac

11 years agoNEWS
Simon McVittie [Fri, 13 Sep 2013 13:02:33 +0000 (14:02 +0100)]
NEWS

11 years agoFix dbus-daemon document about servicedir
Chengwei Yang [Wed, 4 Sep 2013 06:52:21 +0000 (14:52 +0800)]
Fix dbus-daemon document about servicedir

In dbus-daemon implementation, the servicedir are searched in order in
which they appear in the config file.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66994
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoRemove DBUS_COMPILATION from test source code
Chengwei Yang [Wed, 11 Sep 2013 07:27:38 +0000 (15:27 +0800)]
Remove DBUS_COMPILATION from test source code

DBUS_COMPILATION definition was moved to test/Makefile.am static_cppflags,
so remove it from test source code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoCheck EINVAL for accept4()
Chengwei Yang [Thu, 12 Sep 2013 05:38:10 +0000 (13:38 +0800)]
Check EINVAL for accept4()

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>
11 years agoAllow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpair
Pino Toscano [Tue, 10 Sep 2013 14:34:07 +0000 (22:34 +0800)]
Allow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpair

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>
11 years agoCheck EINVAL for socketpair and retry without SOCK_CLOEXEC
Chengwei Yang [Tue, 10 Sep 2013 14:29:19 +0000 (22:29 +0800)]
Check EINVAL for socketpair and retry without SOCK_CLOEXEC

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>
11 years agoUse the argument of dbus_connection_set_route_peer_messages()
Chengwei Yang [Fri, 6 Sep 2013 05:48:38 +0000 (13:48 +0800)]
Use the argument of dbus_connection_set_route_peer_messages()

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>
11 years agoFix pass wrong type of argument to function
Chengwei Yang [Fri, 6 Sep 2013 03:26:44 +0000 (11:26 +0800)]
Fix pass wrong type of argument to function

The last argument of function _dbus_transport_new_for_socket() is
declared as const DBusString *. However, it is passed as a bool value.
Although the value of FALSE equals NULL in fact, this is an incorrect
use of function.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69165
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoFix file descriptor leak in _dbus_command_for_pid
Sviatoslav Chagaev [Tue, 10 Sep 2013 15:23:53 +0000 (18:23 +0300)]
Fix file descriptor leak in _dbus_command_for_pid

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>
11 years ago1.6.15
Simon McVittie [Thu, 5 Sep 2013 16:26:18 +0000 (17:26 +0100)]
1.6.15

11 years ago1.6.14
Simon McVittie [Thu, 5 Sep 2013 15:37:08 +0000 (16:37 +0100)]
1.6.14

11 years ago_dbus_babysitter_unref: avoid infinite loop if waitpid() returns EINTR
Simon McVittie [Wed, 4 Sep 2013 16:53:23 +0000 (17:53 +0100)]
_dbus_babysitter_unref: avoid infinite loop if waitpid() returns EINTR

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>
11 years agodbus-launch: unconditionally use SIGHUP and free memory on OOM
Chengwei Yang [Thu, 27 Jun 2013 01:13:57 +0000 (09:13 +0800)]
dbus-launch: unconditionally use SIGHUP and free memory on OOM

In a previous patch, it check SIGHUP for windows, however, in fact there
is dbus-launch-win.c supposed to be used on windows. So just use SIGHUP
unconditionally.

Also free memory on OOM, although this doesn't make much sense since
this is a oneshort program, rather than a daemon.

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[fixed whitespace -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoNEWS
Simon McVittie [Thu, 5 Sep 2013 12:57:53 +0000 (13:57 +0100)]
NEWS

11 years agoUse GNU make features to reduce repetition
Simon McVittie [Wed, 26 Jun 2013 11:33:29 +0000 (12:33 +0100)]
Use GNU make features to reduce repetition

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48277
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
11 years agoDocument that GNU make is required
Simon McVittie [Wed, 26 Jun 2013 11:27:09 +0000 (12:27 +0100)]
Document that GNU make is required

In theory the Autotools build system supports any "make" implementation,
but there are no regular contributors who test with BSD make, so the
inevitable result is that only GNU make actually works (fd.o #48277).

Apparently there's only one GNUism at the moment, which is fixable,
but that means repeating ourselves a bit more. If we instead document
that GNU make is required, we can simplify the Makefiles over time
by using extensions like $(patsubst), leading to a less error-prone
build system.

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

Conflicts:
NEWS
tools/run-with-tmp-session-bus.sh

11 years agoNEWS
Simon McVittie [Thu, 5 Sep 2013 12:11:45 +0000 (13:11 +0100)]
NEWS

11 years agoNEWS for 1.6
Simon McVittie [Thu, 5 Sep 2013 12:11:31 +0000 (13:11 +0100)]
NEWS for 1.6

11 years agoUse iface instead of interface in function parameters
Ivan Romanov [Thu, 22 Aug 2013 18:11:23 +0000 (19:11 +0100)]
Use iface instead of interface in function parameters

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

11 years agorun-with-tmp-session-bus.sh: create a unique temporary file per process
Simon McVittie [Thu, 5 Sep 2013 12:05:21 +0000 (13:05 +0100)]
run-with-tmp-session-bus.sh: create a unique temporary file per process

This makes the regression tests OK to run in parallel.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 9d80d46a794e0770494aa517d1b94e7e6ea9e21d)

11 years agoNEWS for 1.6
Simon McVittie [Thu, 22 Aug 2013 17:03:24 +0000 (18:03 +0100)]
NEWS for 1.6

11 years agoAdd CPPFLAGS to "shared if possible" test binaries
Simon McVittie [Tue, 3 Sep 2013 11:16:32 +0000 (12:16 +0100)]
Add CPPFLAGS to "shared if possible" test binaries

In principle we ought to define DBUS_STATIC_BUILD in anything that's
using libdbus-internal.la (to avoid linking failures on
statically-linked mingw builds), and DBUS_TEST_USE_INTERNAL in any
test that's using the non-dbus-glib code paths of test-utils.[ch]
(to avoid the GLib requirement, although in practice, everything
"shared if possible" requires GLib at the moment anyway).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agorun-with-tmp-session-bus.sh: create a unique temporary file per process
Simon McVittie [Tue, 3 Sep 2013 11:25:31 +0000 (12:25 +0100)]
run-with-tmp-session-bus.sh: create a unique temporary file per process

This makes the regression tests OK to run in parallel.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoTests: allow dbus-glib to be replaced with use of libdbus-internal
Simon McVittie [Mon, 2 Sep 2013 15:32:31 +0000 (16:32 +0100)]
Tests: allow dbus-glib to be replaced with use of libdbus-internal

We only use dbus-glib for its main loop; within dbus, DBusLoop is
available as an alternative, although it isn't thread-safe and
isn't public API.

For tests that otherwise only use libdbus public API, it's desirable to
be able to avoid DBusLoop, so we can run them against an installed
libdbus as an integration test. However, if we don't have dbus-glib,
we're going to have to use an in-tree main loop, which might as well
be DBusLoop.

The major disadvantage of using dbus-glib is that it isn't safe to
link both dbus-1 and dbus-internal at the same time. This is awkward
for a future test case that wants to use _dbus_getsid() in dbus-daemon.c,
but only on Windows (fd.o #54445). If we use the same API wrapper around
both dbus-glib and DBusLoop, we can compile that test against dbus-glib
or against DBusLoop, depending on the platform.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoDefine DBUS_COMPILATION externally for all tests that use internal stuff
Simon McVittie [Fri, 30 Aug 2013 16:45:52 +0000 (17:45 +0100)]
Define DBUS_COMPILATION externally for all tests that use internal stuff

It might as well go in the AM_CPPFLAGS rather than in the source code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agocorrupt test: close connection before releasing GSocket
Simon McVittie [Mon, 2 Sep 2013 16:14:38 +0000 (17:14 +0100)]
corrupt test: close connection before releasing GSocket

GSocket takes responsibility for closing the fd, and there doesn't
seem to be any way to tell it not to. When this test is adapted to run
under DBusLoop as an alternative to dbus-glib, that becomes a problem,
because DBusLoop/DBusSocketSetEpoll do not tolerate that. Work around it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years ago_dbus_become_daemon: don't pretend it worked
Simon McVittie [Thu, 29 Aug 2013 10:51:45 +0000 (11:51 +0100)]
_dbus_become_daemon: don't pretend it worked

This function is meaningless (and possibly unimplementable) on Windows.
We shouldn't call it; if we do, it should raise an error.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoAllow dbus-daemon --nofork on Windows
Simon McVittie [Thu, 29 Aug 2013 10:49:00 +0000 (11:49 +0100)]
Allow dbus-daemon --nofork on Windows

On Windows, the dbus-daemon is not able to fork (daemonize). If someone
explicitly requests forking, it should fail, but if someone
explicitly requests *not* forking, there seems no harm in allowing it.

A few of the regression tests specifically require a dbus-daemon that
will not fork, so allowing this option on Windows means those tests
don't need an extra OS condition.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoFix declaration of _dbus_win_startup_winsock
Simon McVittie [Mon, 2 Sep 2013 16:31:56 +0000 (17:31 +0100)]
Fix declaration of _dbus_win_startup_winsock

This regressed in commit b7a91bfd.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoFix unused function when SELinux is not enabled
Simon McVittie [Fri, 30 Aug 2013 15:23:22 +0000 (16:23 +0100)]
Fix unused function when SELinux is not enabled

It must be one of the "only smcv tests this" configurations...

11 years agoMove some sysdeps stuff only used by the dbus-daemon outside libdbus
Simon McVittie [Thu, 29 Aug 2013 12:16:14 +0000 (13:16 +0100)]
Move some sysdeps stuff only used by the dbus-daemon outside libdbus

This means we don't need to worry about whether it's thread-safe,
and makes libdbus a little smaller.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years ago_dbus_check_setuid: comment on thread-safety
Simon McVittie [Thu, 29 Aug 2013 11:51:26 +0000 (12:51 +0100)]
_dbus_check_setuid: comment on thread-safety

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years ago_dbus_win_startup_winsock: be thread-safe
Simon McVittie [Thu, 29 Aug 2013 11:51:14 +0000 (12:51 +0100)]
_dbus_win_startup_winsock: be thread-safe

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoComment some suspicious uses of static variables
Simon McVittie [Thu, 29 Aug 2013 11:50:39 +0000 (12:50 +0100)]
Comment some suspicious uses of static variables

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years ago_dbus_get_autolaunch_address: don't make argv static
Simon McVittie [Thu, 29 Aug 2013 11:50:16 +0000 (12:50 +0100)]
_dbus_get_autolaunch_address: don't make argv static

This function could be accessed from any thread, which would mean it
scribbles on argv twice.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years ago_dbus_file_path_extract_elements_from_tail: don't misuse static variable
Simon McVittie [Thu, 29 Aug 2013 11:49:35 +0000 (12:49 +0100)]
_dbus_file_path_extract_elements_from_tail: don't misuse static variable

If we _dbus_verbose() from more than one thread at the same time,
we don't want to get into trouble with static variables (and I don't
think micro-optimizing this function is really worth it anyway).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoRevert "Add a statically-initialized implementation of _dbus_lock() on glibc systems"
Simon McVittie [Fri, 30 Aug 2013 16:24:20 +0000 (17:24 +0100)]
Revert "Add a statically-initialized implementation of _dbus_lock() on glibc systems"

This reverts commit 83aaa9f359e90d3b8cae5d17f6d9ba4600cff68b.

This wasn't right: because it looked for a symbol from pthread.h,
modules could end up disagreeing about whether threading was enabled or
not.

11 years ago_dbus_get_tmpdir: be thread-safe
Simon McVittie [Tue, 27 Aug 2013 13:35:47 +0000 (14:35 +0100)]
_dbus_get_tmpdir: be thread-safe

Sharing a static variable between threads is not safe in general,
and this function is used in the shared libdbus (for nonce files),
so it can't rely on being single-threaded.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agolibdbus-1.la: have proper dependencies on Windows
Simon McVittie [Tue, 27 Aug 2013 12:53:42 +0000 (13:53 +0100)]
libdbus-1.la: have proper dependencies on Windows

Assigning to libdbus_1_la_DEPENDENCIES defeats Automake's normal
dependency logic, which makes libdbus-1.la depend on all the
static libraries that will go into it (it still had a corrct dependency
on the other objects, which go through a separate variable).
This meant libdbus-init-win wasn't necessarily built first.

Use EXTRA_libdbus_1_la_DEPENDENCIES to avoid that problem.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68505
Acked-by: Ralf Habacker <ralf.habacker@freenet.de>
11 years agoGenerate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.
Ralf Habacker [Wed, 28 Aug 2013 12:16:21 +0000 (14:16 +0200)]
Generate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoFixed mingw gcc 4.8.1 complains about double defined macros.
Ralf Habacker [Sat, 29 Jun 2013 10:45:22 +0000 (12:45 +0200)]
Fixed mingw gcc 4.8.1 complains about double defined macros.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
11 years agoFixed gcc 4.8.1 -Wformat warnings on windows.
Ralf Habacker [Tue, 27 Aug 2013 15:32:56 +0000 (17:32 +0200)]
Fixed gcc 4.8.1 -Wformat warnings on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>