platform/upstream/dbus.git
8 years agoFix several BusResult/dbus_bool_t mismatches
Jacek Bukarewicz [Mon, 9 Feb 2015 15:25:31 +0000 (16:25 +0100)]
Fix several BusResult/dbus_bool_t mismatches

They were found by temporarily redefining BusResult in the following way:

 typedef enum { BUS_RESULT_TRUE_E, BUS_RESULT_FALSE_E, BUS_RESULT_LATER_E } bus_result_t;
 typedef struct { bus_result_t result; } BusResult;
 #define BUS_RESULT_TRUE ((BusResult){BUS_RESULT_TRUE_E})
 #define BUS_RESULT_FALSE ((BusResult){BUS_RESULT_FALSE_E})
 #define BUS_RESULT_LATER ((BusResult){BUS_RESULT_LATER_E})

It doesn't compile because equality operator is not defined for structs.
Also, structs are not allowed in switch statement. However, some errors
indicated type mismatches which are now fixed.

Change-Id: I0eb5368359f342e0f4239a2ad95d34b9a8e10a23
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
8 years agoAdd <check own="..." > support
Jacek Bukarewicz [Thu, 27 Nov 2014 10:26:21 +0000 (11:26 +0100)]
Add <check own="..." > support

Policy result unavailability is handled like send rules - dispatching
messages from the sender is blocked and resumed when result becomes
available.

Handler of "RequestName" method needs to return BUS_RESULT_LATER when
policy result is not known therefore its return type is modified.
Since bus message handlers are put into function pointer array other
message handler function singatures are also affected.

Change-Id: I4c2cbd4585e41fccd8a30f825a8f0d342ab56755

8 years agoHandle receive rule result unavailability and message broadcasts
Jacek Bukarewicz [Fri, 28 Nov 2014 11:39:33 +0000 (12:39 +0100)]
Handle receive rule result unavailability and message broadcasts

When message is sent to the addressed recipient and receive rule
result is unavailable we don't want to block the sender
as it most likely will be the privileged service, so instead we queue
it at the recipient. Any further messages sent to it will be queued to
maintain message order. Once the answer from Cynara arrives messages are
dispatched from the recipient queue. In such case full dispatch is
performed - messages are sent to addressed recipient and other
interested connections.
Messages sent to non-addressed recipients (eavesdroppers or broadcast
message recipients) are handled in a similar way. The difference is
that it is not full dispatch meaning message is sent to a single recipient.

Change-Id: Iecd5395f75a4c7811fa97247a37d8fc4d42e8814

8 years agoDisable message dispatching when send rule result is not known
Jacek Bukarewicz [Fri, 28 Nov 2014 11:07:39 +0000 (12:07 +0100)]
Disable message dispatching when send rule result is not known

When unicast message to addressed recipient is sent and policy result
is not available message dispatch from the sender is disabled.
This also means that any further messages from the given connection are
put into the incoming queue. If response is received message dispatching
is resumed. This time answer is expected to be in cache so the message is
processed synchronously.
Receive rule result unavailability is not yet handled - such messages are
rejected. Also, if message is sent to non-addressed recipient message
is silently dropped.

Change-Id: Ia45905baf667ca42f386c1def108eca190d615bb

8 years agoIntegration of asynchronous security checks
Jacek Bukarewicz [Thu, 27 Nov 2014 17:11:05 +0000 (18:11 +0100)]
Integration of asynchronous security checks

This commit introduces basic framework for asynchronous policy
checks and Cynara integration code. Functions for checking security
policy can now return third value - BUS_RESULT_LATER denoting check
result unavailability. Whenever policy checker cannot decide on the
result of the check it is supposed to allocate DeferredMessage structure
that will be passed to the upper layers which can decide what should be
done in such situation.
Proper handling of such case will be implemented in subsequent commits.
Currently such return value results in message denial.

Change-Id: I324b6ab68442e493853d8fe219c7a37fbd831872

8 years agopolicy: add <check> element
Patrick Ohly [Wed, 30 Jul 2014 08:00:59 +0000 (10:00 +0200)]
policy: add <check> element

The new <check> element is almost the same as <allow> and <deny>. The
difference is that it has an additional "privilege" parameter which
will be tested at runtime. Depending on the outcome of the check, the
rule turns into an allow or deny rule.

Executing these checks will be implemented separately. At the moment,
a <check> is basically the same as <deny>.

The representation of a rule grows by one additional pointer and needs
one additional bit to represent <check> in addition to <allow>/<deny>.
Reordering elements might mitigate this effect.

Change-Id: I25baa802fdf41413a78200273c3a0b17ae7f1cfa

8 years agoGetConnectionCredentials - add smack support
Patrick Ohly [Fri, 20 Jun 2014 14:55:00 +0000 (16:55 +0200)]
GetConnectionCredentials - add smack support

A process should never change its Smack label while connected to
D-Bus. If it did, we would end up with race conditions around
permission checking. Therefore we can retrieve the Smack label once,
when the process connects, and use that label whenever it is needed.

A new public libdbus API also gets added: dbus_connection_get_smack_label()
This is primarily for dbus-daemon, but may also be useful for other applications
creating direct connections.

Change-Id: I16ec50a031809aab879a543ec2d7effd56768bf1

8 years agoDrop capabilities in user dbus session
Rafal Krypa [Wed, 29 Oct 2014 10:39:37 +0000 (11:39 +0100)]
Drop capabilities in user dbus session

In the systemd user service file, drop all process capabilities. The
capabilities will be inherited from parent process (systemd --user). They
are meant to be inherited by launcher process, but are of no use for
dbus. Since they would give unneeded privileges to dbus, they should be
dropped.

Change-Id: I89a1a1b21d07380f68c9933aab272ebe2b08a889
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoUpdate packaging to 1.8.2
Patrick Ohly [Fri, 20 Jun 2014 13:29:53 +0000 (15:29 +0200)]
Update packaging to 1.8.2

Change-Id: I8c0bdcaa11802e992c43c629d3f413d21bd9d159

8 years agoadd a small script in /etc/profile.d/dbus.sh to export DBUS_SESSION_BUS_ADDRESS
Stephane Desneux [Thu, 23 Oct 2014 11:21:39 +0000 (13:21 +0200)]
add a small script in /etc/profile.d/dbus.sh to export DBUS_SESSION_BUS_ADDRESS

If the dbus session address is not defined, this small script will try to
pick the address from the environment of the systemd --user process for the current
user.

Typically, this allows to log on a target through ssh, then run su - <user> and
have the same environment as the shells inside the user session.

Change-Id: Id6133077bf9943c4203f7d993b8942dc1455bef5
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agoMake dbus-1 dependency provided by dbus
Jacek Bukarewicz [Thu, 4 Sep 2014 08:50:59 +0000 (10:50 +0200)]
Make dbus-1 dependency provided by dbus

dbus-1 was originally provided by dbus package. Commit 8eeae5fd70
fixed circular dependency between dbus and systemd. It also moved
dbus-1 provision from dbus to dbus-devel probably by mistake.
Certain packages like gumd or polkit have explicit dependency on
dbus-1 which makes them install dbus-devel unnecessarily.

Change-Id: I77a6561eff6f8c6ce84d849df936dda2c290a4d2
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
8 years agodbus-x11 should not try to build into a pure wayland platform.
Ronan Le Martret [Wed, 29 Jan 2014 11:06:31 +0000 (12:06 +0100)]
dbus-x11 should not try to build into a pure wayland platform.

This package is designed for an X server platform.

In a system released, based exclusively on Wayland platform, it should be in a excluded status.

Tizen devel  | Tizen release
_____________|______________
succeeded    | succeeded
excluded     | excluded
broken       |
failed       |
unresolvable |
blocked      |
locked       |
note:
    - The disabled status is only
      allowed for OBS administration.

Change-Id: I1495b66a2e32b580223229ead6bc66426ff680a6
Signed-off-by: Ronan Le Martret <ronan@fridu.net>
8 years agolibdbus:build-require pkg-config
Adrian Negreanu [Mon, 25 Nov 2013 12:11:14 +0000 (14:11 +0200)]
libdbus:build-require pkg-config

otherwise, configure fails to find libsmack, which
happens to be the first lib searched with pkg-config

  checking for _NSGetEnviron... no
  checking for LIBSMACK... configure: error: libsmack is
  required to enable smack support
  error: Bad exit status from /var/tmp/rpm-tmp.VUiY9N

Change-Id: Ibf01a52ae6274503e2490f835fbd686e985807e8
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
8 years agopackaging: enable Smack support
Patrick McCarty [Mon, 7 Oct 2013 19:39:15 +0000 (12:39 -0700)]
packaging: enable Smack support

Change-Id: Ib400feec8193bb5c98347b778e0aa92a30d954c3
Signed-off-by: Patrick McCarty <patrick.mccarty@linux.intel.com>
8 years agoInstall dbus directories
Chengwei Yang [Tue, 10 Sep 2013 10:26:16 +0000 (18:26 +0800)]
Install dbus directories

At previous, these directories owned by libdbus. However, the previous
commit 8eeae5f split libdbus into a separate .spec and doesn't install
these directoris.

These directoris are critical to dbus, for example, without
/etc/dbus-1/{system.d,session.d}, the dbus-daemon system bus and session
bus can not launch.

Change-Id: Ia98bd56171492c90e4a078b39adf08cc802cb955

8 years agofix systemd->dbus->systemd circular dependency
Adrian Negreanu [Tue, 6 Aug 2013 12:02:04 +0000 (15:02 +0300)]
fix systemd->dbus->systemd circular dependency

extract libdbus and dbus-devel as separate packages

Change-Id: Ia097a2b3fee2911ee89000dd2d5762a112bf17f6
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
8 years agoupdating changelog
Michael Leibowitz [Mon, 22 Jul 2013 12:56:06 +0000 (05:56 -0700)]
updating changelog

8 years agoEnforce smack policy from conf file
Brian McGillion [Mon, 6 Feb 2012 16:48:30 +0000 (18:48 +0200)]
Enforce smack policy from conf file

8 years agoEnable checking of smack context from DBus interface
Brian McGillion [Mon, 6 Feb 2012 16:46:05 +0000 (18:46 +0200)]
Enable checking of smack context from DBus interface

Conflicts:
bus/driver.c
cmake/CMakeLists.txt

Change-Id: Ibc9d1ccb86c3b28d8df3a4becf33ba30234832d8

8 years agoresetting manifest requested domain to floor
Alexandru Cornea [Fri, 28 Jun 2013 20:42:49 +0000 (23:42 +0300)]
resetting manifest requested domain to floor

8 years agoUpdate to dbus 1.6.12
Anas Nashif [Wed, 19 Jun 2013 10:16:37 +0000 (06:16 -0400)]
Update to dbus 1.6.12

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
8 years agoupdate changelog
Simon McVittie [Wed, 19 Jun 2013 14:31:03 +0000 (15:31 +0100)]
update changelog

- TZPC-3044, CVE-2013-2168: fix local denial of service (backport from 1.6.12)
- TZPC-1971: make libdbus thread-safe by default (backport from 1.7.4/1.7.6)

8 years agopackaging: ensure ownership for /var/lib/dbus
Patrick McCarty [Fri, 7 Jun 2013 22:53:20 +0000 (15:53 -0700)]
packaging: ensure ownership for /var/lib/dbus

For x86_64 builds, %{_localstatedir}%{_libdir}/dbus expands to
/var/usr/lib64/dbus, which is incorrect.

This commit fixes the path in the spec to make sure the intended
directory, /var/lib/dbus, is created and owned by this package.

Change-Id: I60947c4e2c221ad2f83d01bd87dc76fc8f5e4433

8 years agoUpdate to 1.6.10
Anas Nashif [Mon, 27 May 2013 03:43:02 +0000 (23:43 -0400)]
Update to 1.6.10

8 years agoupdate to 1.6.10
Anas Nashif [Sun, 26 May 2013 18:52:43 +0000 (14:52 -0400)]
update to 1.6.10

8 years agoAdapt for rebase onto upstream dbus-1.6.8 git tag
Simon McVittie [Tue, 16 Apr 2013 17:34:16 +0000 (18:34 +0100)]
Adapt for rebase onto upstream dbus-1.6.8 git tag

When building from git we need a BuildRequires on xmlto, since we can
no longer rely on the pre-generated HTML documentation from the tarball.

That pulls in libxslt-tools, which means dbus.devhelp is generated, so
the build fails because we weren't accounting for that; so explicitly
require libxslt-tools too (dbus uses it both via xmlto, and directly),
and package dbus.devhelp.

Change-Id: I7505fc6fd1e7c4fc23a53f349a4fdd18d88237ec

8 years agoCleanup lib name in spec
Anas Nashif [Thu, 28 Mar 2013 13:15:58 +0000 (06:15 -0700)]
Cleanup lib name in spec

8 years agouse libname directly
Anas Nashif [Thu, 28 Mar 2013 13:15:12 +0000 (06:15 -0700)]
use libname directly

8 years agoFixed package groups
Anas Nashif [Fri, 22 Mar 2013 18:36:11 +0000 (11:36 -0700)]
Fixed package groups

8 years agoNo OOMScoreAdjust for user session
Anas Nashif [Wed, 16 Jan 2013 03:13:39 +0000 (19:13 -0800)]
No OOMScoreAdjust for user session

8 years agoadd user session units
Anas Nashif [Mon, 31 Dec 2012 15:56:22 +0000 (07:56 -0800)]
add user session units

8 years agoadd user session units
Anas Nashif [Mon, 31 Dec 2012 15:50:37 +0000 (07:50 -0800)]
add user session units

8 years agoinitial changelog
Simon McVittie [Fri, 30 Nov 2012 16:52:54 +0000 (16:52 +0000)]
initial changelog

8 years agoregenerate packaging/dbus-x11.spec with ( cd packaging && sh pre_checkin.sh )
Simon McVittie [Thu, 29 Nov 2012 11:10:36 +0000 (11:10 +0000)]
regenerate packaging/dbus-x11.spec with ( cd packaging && sh pre_checkin.sh )

Otherwise, local builds with 'gbs build' try to apply the nonexistent
patch 0001-fix-sba-for-dbus-activation.patch, and fail.

8 years agofixed splitting
Anas Nashif [Fri, 16 Nov 2012 18:45:18 +0000 (10:45 -0800)]
fixed splitting

8 years agofixed splitting
Anas Nashif [Fri, 16 Nov 2012 18:25:40 +0000 (10:25 -0800)]
fixed splitting

8 years agofixed splitting
Anas Nashif [Fri, 16 Nov 2012 18:24:32 +0000 (10:24 -0800)]
fixed splitting

8 years agoFixed package splitting
Anas Nashif [Fri, 16 Nov 2012 17:26:26 +0000 (09:26 -0800)]
Fixed package splitting

split dbus-x11 correctly

8 years agospec cleanup and removed patches
Anas Nashif [Fri, 16 Nov 2012 01:50:16 +0000 (17:50 -0800)]
spec cleanup and removed patches

8 years agoadd packaging
Anas Nashif [Tue, 30 Oct 2012 23:28:05 +0000 (16:28 -0700)]
add packaging

9 years ago1.10.6 dbus-1.10.6
Simon McVittie [Tue, 1 Dec 2015 18:19:17 +0000 (18:19 +0000)]
1.10.6

9 years agoNEWS for 1.10 branch
Simon McVittie [Mon, 23 Nov 2015 21:10:09 +0000 (21:10 +0000)]
NEWS for 1.10 branch

9 years agouid-permissions test: don't assert that root can UpdateActivationEnvironment
Simon McVittie [Fri, 20 Nov 2015 17:19:51 +0000 (17:19 +0000)]
uid-permissions test: don't assert that root can UpdateActivationEnvironment

Since 1.10.4 this is hard-coded to be disallowed when an activation
helper is used. That would be a security flaw waiting to happen,
and makes little sense anyway, because the activation helper sanitises
its environment.

Use BecomeMonitor() instead, as our way to assert that root and
messagebus are privileged.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93036
Reviewed-by: Iain Lane
9 years agoname-test: don't run these tests with autotools if targeting Windows.
Simon McVittie [Tue, 17 Nov 2015 16:42:01 +0000 (16:42 +0000)]
name-test: don't run these tests with autotools if targeting Windows.

The wrapper shell script that sets up their environment is nowhere
near being portable. In particular, it uses dbus-run-session,
which is Unix-specific.

[rh: Add autotools scope in commit title]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Rewieved-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoWindows _dbus_get_autolaunch_address: don't leak shm_name
Simon McVittie [Wed, 18 Nov 2015 22:38:20 +0000 (23:38 +0100)]
Windows _dbus_get_autolaunch_address: don't leak shm_name

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years ago1.10.5
Simon McVittie [Tue, 17 Nov 2015 23:46:34 +0000 (23:46 +0000)]
1.10.5

9 years agodbus 1.10.4
Simon McVittie [Tue, 17 Nov 2015 21:40:36 +0000 (21:40 +0000)]
dbus 1.10.4

9 years agoNEWS
Simon McVittie [Tue, 17 Nov 2015 18:22:37 +0000 (18:22 +0000)]
NEWS

9 years agobus-driver: Support returning org.freedesktop.DBus UID and PID
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:43 +0000 (16:32 +0100)]
bus-driver: Support returning org.freedesktop.DBus UID and PID

Attempting to call SetEnvironment on systemd causes it to inquire
about the caller's connection UID and PID. If this check fails,
the call is rejected.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: go back to DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN as the error code
for failure to determine the pid]

9 years agotest/sd-activation: Test UpdateActivationEnvironment forwarding
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:42 +0000 (16:32 +0100)]
test/sd-activation: Test UpdateActivationEnvironment forwarding

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agobus_driver_handle_update_activation_environment: Forward to systemd
Jan Alexander Steffens (heftig) [Sun, 15 Nov 2015 15:00:33 +0000 (16:00 +0100)]
bus_driver_handle_update_activation_environment: Forward to systemd

If we use systemd activation, forward all UpdateActivationEnvironment
requests to org.freedesktop.systemd1.Manager.SetEnvironment, in order
to ensure variables needed by D-Bus services are available when these
services are launched by systemd.

Since UpdateActivationEnvironment is not available on the system bus,
this only applies to user buses.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agobus_driver_handle_update_activation_environment: Error on system buses
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:37 +0000 (16:32 +0100)]
bus_driver_handle_update_activation_environment: Error on system buses

The default policy already disallows calls on system buses. Since any
bus with a service helper cleans the environment anyway, there's no
point in allowing this to be called.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agofdpass test: assert that TCP connections don't say they can pass fds
Simon McVittie [Tue, 17 Nov 2015 13:23:30 +0000 (13:23 +0000)]
fdpass test: assert that TCP connections don't say they can pass fds

As well as slightly increasing our test coverage, this ensures
that at least one test-case in this test is not skipped, working
around CMake's lack of support for the Automake-style exit code
produced by GTest executables (they exit 77 if everything was skipped).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92887
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoFix recursive loop in backtrace generator on windows.
Ralf Habacker [Sun, 15 Nov 2015 18:54:03 +0000 (19:54 +0100)]
Fix recursive loop in backtrace generator on windows.

Backtrace generator called _dbus_warn(), which calls
backtrace generator recursively with DBUS_FATAL_WARNINGS=1.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoDo not fail with fatal message skipping GetConnectionUnixProcessID test-bus test...
Ralf Habacker [Fri, 13 Nov 2015 18:48:16 +0000 (19:48 +0100)]
Do not fail with fatal message skipping GetConnectionUnixProcessID test-bus test on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix test-bus test for GetConnectionUnixUser driver method on windows.
Ralf Habacker [Fri, 13 Nov 2015 18:41:43 +0000 (19:41 +0100)]
Fix test-bus test for GetConnectionUnixUser driver method on windows.

Because GetConnectionUnixUser is not supported on windows it fails with
DBUS_ERROR_FAIL.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoSkip launch helper activation tests on windows silently.
Ralf Habacker [Thu, 12 Nov 2015 11:49:46 +0000 (12:49 +0100)]
Skip launch helper activation tests on windows silently.

The system bus is unsupported there and Windows does not
have any concept of setuid binaries, so it can't ever
actually work.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix memory leak in _dbus_win_set_error_from_win_error().
Ralf Habacker [Wed, 11 Nov 2015 14:02:44 +0000 (15:02 +0100)]
Fix memory leak in _dbus_win_set_error_from_win_error().

There is no need to make a local (leaked) copy of the message,
because dbus_set_error() already makes a copy of its parameters.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix memory leaks in bus_activation_service_reload_test() in case of errors.
Ralf Habacker [Wed, 11 Nov 2015 14:02:00 +0000 (15:02 +0100)]
Fix memory leaks in bus_activation_service_reload_test() in case of errors.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoRevert "Fix memory leaks in bus_activation_service_reload_test() in case of errors."
Ralf Habacker [Wed, 11 Nov 2015 14:01:11 +0000 (15:01 +0100)]
Revert "Fix memory leaks in bus_activation_service_reload_test() in case of errors."

This reverts commit d8569ac647da4d62c7a251d8e809f2d545a77837.

9 years agoFix memory leaks in bus_activation_service_reload_test() in case of errors.
Ralf Habacker [Mon, 9 Nov 2015 12:38:59 +0000 (13:38 +0100)]
Fix memory leaks in bus_activation_service_reload_test() in case of errors.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: https://bugs.freedesktop.org/show_bug.cgi?id=92721
9 years agoFix test-bus segfault_service_no_auto_start test on windows.
Ralf Habacker [Mon, 9 Nov 2015 19:38:03 +0000 (20:38 +0100)]
Fix test-bus segfault_service_no_auto_start test on windows.

Windows returns unhandled exceptions from a running child
by specific exit codes and not by signals as on UNIX.

Therefore we use DBUS_ERROR_SPAWN_CHILD_EXITED for propagating
unhandled exceptions to the parent too.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoupdate NEWS
Simon McVittie [Fri, 6 Nov 2015 17:26:40 +0000 (18:26 +0100)]
update NEWS

9 years agoFix test cases running client and server dispatch design issue.
Ralf Habacker [Fri, 6 Nov 2015 13:03:23 +0000 (14:03 +0100)]
Fix test cases running client and server dispatch design issue.

DBus test cases running the server *and* client loop in the same
process assumed that all messages send from the server has to be
received in one client dispatch, which is not the case in all
environments.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix bug unrefing connection too early in check_hello_message().
Ralf Habacker [Fri, 6 Nov 2015 13:02:29 +0000 (14:02 +0100)]
Fix bug unrefing connection too early in check_hello_message().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoCompile fix on Windows.
Ralf Habacker [Wed, 4 Nov 2015 13:21:20 +0000 (14:21 +0100)]
Compile fix on Windows.

This commit fixes a regression introduced with commit 04b8a7a772cfa9ae8ea6ce452d1fb7f23e25fd3f.

9 years agoFix warning: variable 'ret' set but not used [-Wunused-but-set-variable].
Ralf Habacker [Mon, 2 Nov 2015 20:56:32 +0000 (21:56 +0100)]
Fix warning: variable 'ret' set but not used [-Wunused-but-set-variable].

Only set valid child status in case exit code has been gotten from
child process, otherwise signal failure through thread return value.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoTest system bus config files on Unix only
Ralf Habacker [Mon, 2 Nov 2015 23:23:56 +0000 (00:23 +0100)]
Test system bus config files on Unix only

Previously, we didn't consistently test parsing of every file in
valid-config-files-system/ everywhere that we tested valid-config-files/.
We now test it on Unix.

The system bus is not supported on Windows, so we do not test
valid-config-files-system/ there.

valid-config-files/many-rules.conf contains <user> and <group> rules
which are not applicable to Windows. Copy the original many-rules.conf
to valid-config-files-system/ so that it will be tested on Unix, and
remove the non-portable rules from valid-config-files/many-rules.conf.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[rh:base patch came from Simon]

9 years agoDon't use _dbus_warn() for intentionally-skipped tests
Simon McVittie [Mon, 2 Nov 2015 18:19:02 +0000 (18:19 +0000)]
Don't use _dbus_warn() for intentionally-skipped tests

The tests are run with _dbus_warn() fatal, so if a particular test is
not applicable on the current platform, we shouldn't call it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agotest_default_session_servicedirs: use the intended data directory
Simon McVittie [Mon, 2 Nov 2015 14:24:51 +0000 (14:24 +0000)]
test_default_session_servicedirs: use the intended data directory

If D-Bus was configured for /usr/local and built in Z:/build,
the previous code would use

    Z:/build/dbus/.libs/usr/local/share/dbus-1/services

whereas the intention was to replace the configured prefix /usr/local
with the detected location, more like

    Z:/build/dbus/.libs/share/dbus-1/services

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agotest_default_session_servicedirs: simplify to a single exit code-path
Simon McVittie [Mon, 2 Nov 2015 14:15:14 +0000 (14:15 +0000)]
test_default_session_servicedirs: simplify to a single exit code-path

A similar simplification was already done on master as part of commit
f830e14, Bug #83539.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoFix warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement].
Ralf Habacker [Sat, 31 Oct 2015 20:06:04 +0000 (21:06 +0100)]
Fix warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement].

Includes minor indention fix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoFix typo and missing eol on debug message.
Ralf Habacker [Sat, 31 Oct 2015 20:05:03 +0000 (21:05 +0100)]
Fix typo and missing eol on debug message.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agorefs test: reduce number of repeats under Wine
Simon McVittie [Thu, 29 Oct 2015 05:31:38 +0000 (06:31 +0100)]
refs test: reduce number of repeats under Wine

Under Wine, the API calls we use to do this are implemented via IPC
to wineserver, which makes it unreasonably slow to try to brute-force
bugs by having many threads stress-test refcounting. Do a few
repetitions just to verify that refcounting basically works, but
don't do the full stress-test.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[rh: add WINESERVERSOCKET related hint]

9 years agoWhen running TAP tests, filter out trailing \r from Windows .exe
Simon McVittie [Mon, 19 Oct 2015 15:02:36 +0000 (16:02 +0100)]
When running TAP tests, filter out trailing \r from Windows .exe

If we're running Windows executables using Wine, then tap-driver.sh
won't accept "1..4\r\n" as TAP syntax.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoFix crash running test-syslog on windows/wine.
Ralf Habacker [Tue, 3 Feb 2015 18:56:32 +0000 (19:56 +0100)]
Fix crash running test-syslog on windows/wine.

Use seperate buffer in _dbus_system_logv() to avoid crash in vsprintf().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoDisplay autolaunch scope on verbose print of daemon found message on windows.
Ralf Habacker [Sun, 4 Oct 2015 08:33:32 +0000 (10:33 +0200)]
Display autolaunch scope on verbose print of daemon found message on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92080
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years ago1.10.3
Simon McVittie [Mon, 26 Oct 2015 18:54:04 +0000 (18:54 +0000)]
1.10.3

9 years ago1.10.2
Simon McVittie [Mon, 26 Oct 2015 12:54:26 +0000 (12:54 +0000)]
1.10.2

9 years agoAdd a regression test for invalid BecomeMonitor calls
Simon McVittie [Mon, 19 Oct 2015 13:50:37 +0000 (14:50 +0100)]
Add a regression test for invalid BecomeMonitor calls

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

9 years agoNEWS
Simon McVittie [Mon, 26 Oct 2015 12:05:09 +0000 (12:05 +0000)]
NEWS

9 years agouser dbus.socket: Set DBUS_SESSION_BUS_ADDRESS
Jan Alexander Steffens (heftig) [Thu, 22 Oct 2015 17:50:29 +0000 (19:50 +0200)]
user dbus.socket: Set DBUS_SESSION_BUS_ADDRESS

As discussed in <https://github.com/systemd/systemd/issues/1600>.
See also <https://bugs.archlinux.org/task/46721>,
<https://bugzilla.gnome.org/show_bug.cgi?id=756420>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92612
[smcv: use AC_PATH_PROG to find systemctl; ignore systemctl failure]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
[smcv: add links to earlier bug reports elsewhere]

9 years agoWhen running dbus-daemon --session in tests, override listen address
Simon McVittie [Mon, 19 Oct 2015 14:19:27 +0000 (15:19 +0100)]
When running dbus-daemon --session in tests, override listen address

Otherwise, we can't reliably run tests for Windows, because the default
listening address on Windows is "autolaunch:" which is global to
a machine, resulting in testing an installed dbus-daemon instead of
the one we intended to test.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoDisable activation tests on Windows builds
Simon McVittie [Mon, 19 Oct 2015 14:18:02 +0000 (15:18 +0100)]
Disable activation tests on Windows builds

These rely on the --systemd-activation code path, which is not
compiled for Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoKeep cmake build system in sync with autotools (add test-monitor).
Ralf Habacker [Wed, 21 Oct 2015 11:19:48 +0000 (13:19 +0200)]
Keep cmake build system in sync with autotools (add test-monitor).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoNEWS
Simon McVittie [Mon, 19 Oct 2015 15:37:34 +0000 (16:37 +0100)]
NEWS

9 years agoBecomeMonitor: do not overwrite error with another error
Simon McVittie [Tue, 6 Oct 2015 11:43:22 +0000 (12:43 +0100)]
BecomeMonitor: do not overwrite error with another error

If the user gave us a syntactically invalid error name, we'd
overwrite the MatchRuleInvalid error with NoMemory, causing an
assertion failure (crash) in the dbus-daemon.

This is not a denial-of-service vulnerability on the system bus,
because monitoring is a privileged action, and root privilege
is checked before this code is reached. However, it's an annoying
bug on the session bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
9 years agoNEWS
Simon McVittie [Fri, 2 Oct 2015 10:51:40 +0000 (11:51 +0100)]
NEWS

9 years agoOn Windows, load local configuration relative to bus setup
Simon McVittie [Thu, 1 Oct 2015 18:17:49 +0000 (19:17 +0100)]
On Windows, load local configuration relative to bus setup

This makes an installed tree with

    /some-prefix/
        etc/
            dbus-1/
                session-local.conf
        share/
            dbus-1/
                session.conf

relocatable to any location.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoCancel pending activation on any activation error
Simon McVittie [Wed, 30 Sep 2015 16:15:53 +0000 (17:15 +0100)]
Cancel pending activation on any activation error

This fixes the error reporting if you make two attempts
to activate a service that cannot be activated due to an
error that is reported synchronously, such as a system
service with no User= line in its .service file.

This is easy to reproduce with the gdbus(1) tool, which
sends an Introspect call in addition to the one you asked
it to. If you try to activate a service using

gdbus call --session -d com.example.FailToActivate \
    -o / -m org.freedesktop.DBus.Peer.Ping

then gdbus will actually send two method calls: one
Introspect, and one Ping. The Introspect gets the correct
error reply, but when dbus-daemon enters
bus_activation_activate_service() for the Ping call, it
sees that there is a pending activation and does an
early-return. The pending activation does not finish
until the timeout is reached.

A couple of error cases handled this correctly, but the
majority did not; make them all go into the same code path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92200
Reviewed-by: Thiago Macieira <thiago@kde.org>
9 years agoNEWS
Simon McVittie [Wed, 30 Sep 2015 14:49:06 +0000 (15:49 +0100)]
NEWS

9 years agoFix creation of Exec path for files not in prefix
Milan Crha [Fri, 18 Sep 2015 15:22:29 +0000 (16:22 +0100)]
Fix creation of Exec path for files not in prefix

Doing strcat() into a static buffer produces incorrect results for
the second and subsequent services if they are not in the ${prefix};
for example, if the first call should have returned
"C:\bar\bin\service1" and the second should have returned
"C:\bar\bin\service2", the second result would actually be
"C:\bar\bin\service1C:\bar\bin\service2".

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: added commit message; used strncpy/strncat to avoid overflow]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agoMake Windows dbus-daemon look for the config file we install
Ralf Habacker [Sun, 20 Sep 2015 11:47:23 +0000 (13:47 +0200)]
Make Windows dbus-daemon look for the config file we install

The canonical location for bus setup changed from
${sysconfdir}/dbus-1 to ${datadir}/dbus-1 (or their CMake
equivalents) in version 1.9.18.

Also stop trying to use bus/session.conf from the build tree,
which will not work if our ${prefix} contains an older
${sysconfdir}/dbus-1/session.conf.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
9 years agomention o.fd.DBus.Verbose in the NEWS too
Simon McVittie [Tue, 25 Aug 2015 18:54:18 +0000 (19:54 +0100)]
mention o.fd.DBus.Verbose in the NEWS too

9 years agostart towards 1.10.2
Simon McVittie [Tue, 25 Aug 2015 18:34:54 +0000 (19:34 +0100)]
start towards 1.10.2

9 years ago1.10.0
Simon McVittie [Tue, 25 Aug 2015 15:51:59 +0000 (16:51 +0100)]
1.10.0

9 years agoaudit: make the first few fds close-on-exec
Simon McVittie [Wed, 19 Aug 2015 22:47:40 +0000 (23:47 +0100)]
audit: make the first few fds close-on-exec

libcap-ng < 0.7.7 leaks one non-close-on-exec fd during initialization.
test-bus asserts that all fds beyond 2 passed to an executed subprocess
have the close-on-exec flag set, which will fail at that leaked fd.

This was unnoticed until commit 517c4685, because libaudit was
previously only initialized if we were configured to switch uid,
which the regression tests do not do; the system bus is normally
the only place that happens, but the system bus is not normally
run with the "embedded tests" enabled (since they are bad
for performance and security).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91684
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
9 years agoDistribute tap-test.sh.in unconditionally
Simon McVittie [Wed, 19 Aug 2015 21:04:30 +0000 (22:04 +0100)]
Distribute tap-test.sh.in unconditionally

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91684
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
9 years ago1.9.21
Simon McVittie [Thu, 6 Aug 2015 23:15:34 +0000 (00:15 +0100)]
1.9.21

9 years agoPrepare 1.9.20 (1.10rc1)
Simon McVittie [Thu, 6 Aug 2015 17:55:31 +0000 (18:55 +0100)]
Prepare 1.9.20 (1.10rc1)