]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
5 years agobus: Don't explicitly clear BusConnections.monitors
Simon McVittie [Thu, 20 Feb 2020 00:36:53 +0000 (00:36 +0000)] 
bus: Don't explicitly clear BusConnections.monitors

Each connection that is an active monitor holds a pointer to its own
link in this list, via BusConnectionData.link_in_monitors. We can't
validly free the list while these pointers exist: that would be a
use-after-free, when each connection gets disconnected and tries to
remove itself from the list.

Instead, let each connection remove itself from the list, then assert
that the list has become empty.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/291

5 years agoMerge branch 'let-dbus_verbose_real-use-dbus-string' into 'master'
Simon McVittie [Thu, 20 Feb 2020 08:50:01 +0000 (08:50 +0000)] 
Merge branch 'let-dbus_verbose_real-use-dbus-string' into 'master'

In _dbus_verbose_real() use DBusString instance to avoid possible stack smashing

Closes #45

See merge request dbus/dbus!133

5 years agoIn _dbus_verbose_real() avoid possible stack overflows on output to the Windows debug...
Ralf Habacker [Thu, 20 Feb 2020 08:50:00 +0000 (08:50 +0000)] 
In _dbus_verbose_real() avoid possible stack overflows on output to the Windows debug port

Instead of creating a fixed memory area on the stack that can lead to
a stack overflow if exceeded, this configuration now uses a DBusString
instance that dynamically manages memory.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/45

5 years agoMerge branch 'utf8-compliant-versioninfo' into 'master'
Simon McVittie [Thu, 20 Feb 2020 08:34:04 +0000 (08:34 +0000)] 
Merge branch 'utf8-compliant-versioninfo' into 'master'

Transcoding template file for version information under Windows to utf-8

See merge request dbus/dbus!139

5 years agoUpdate copyright year in file template for version info on Windows
Ralf Habacker [Thu, 20 Feb 2020 07:47:55 +0000 (08:47 +0100)] 
Update copyright year in file template for version info on Windows

5 years agoMake template file for version info under Windows utf-8 compliant
Ralf Habacker [Thu, 20 Feb 2020 07:42:43 +0000 (08:42 +0100)] 
Make template file for version info under Windows utf-8 compliant

5 years agoMerge branch 'fix-libdbus-version-info' into 'master'
Simon McVittie [Thu, 20 Feb 2020 01:02:48 +0000 (01:02 +0000)] 
Merge branch 'fix-libdbus-version-info' into 'master'

Fix libdbus version info

See merge request dbus/dbus!138

5 years agocmake: Fix attribute 'original file name' in shared dbus library file info on Windows
Ralf Habacker [Wed, 19 Feb 2020 10:12:07 +0000 (11:12 +0100)] 
cmake: Fix attribute 'original file name' in shared dbus library file info on Windows

The 'original filename' attribute was 'libdbus-1-3}.dll' with an unwanted
curly bracket.

5 years agoMerge branch 'complete-version-info-on-windows' into 'master'
Simon McVittie [Wed, 19 Feb 2020 20:58:16 +0000 (20:58 +0000)] 
Merge branch 'complete-version-info-on-windows' into 'master'

cmake: complete adding version info to all installed executables on Windows

See merge request dbus/dbus!136

5 years agocmake: complete adding version info to all installed executables on Windows
Ralf Habacker [Wed, 19 Feb 2020 09:23:01 +0000 (10:23 +0100)] 
cmake: complete adding version info to all installed executables on Windows

5 years agoMerge branch 'master' into 'master'
Simon McVittie [Thu, 23 Jan 2020 11:36:21 +0000 (11:36 +0000)] 
Merge branch 'master' into 'master'

cmake: add X11 include directories to tools

See merge request dbus/dbus!129

5 years agocmake: Add X11 include path for tools
Tuomo Rinne [Wed, 22 Jan 2020 21:31:15 +0000 (21:31 +0000)] 
cmake: Add X11 include path for tools

Fixes compilation issues for case when X11 is not in a standard location

5 years agoMerge branch 'fix-static-vars-thread-safety-issues' into 'master'
Ralf Habacker [Fri, 13 Dec 2019 15:20:59 +0000 (15:20 +0000)] 
Merge branch 'fix-static-vars-thread-safety-issues' into 'master'

Fix static vars thread safety issues

Related to dbus/dbus#88

See merge request dbus/dbus!132

5 years agoAdd a trivial sanity-check for the atomic primitives
Ralf Habacker [Thu, 12 Dec 2019 08:34:58 +0000 (09:34 +0100)] 
Add a trivial sanity-check for the atomic primitives

This doesn't verify that they're atomic, but does verify that they
return the right things.

This commit adds a new test function _dbus_test_check (a) to make
writing tests easier. It checks the given boolean expression and
generates a "not ok" test result if the expression is false.

Due to the current design of the test api, the test is only compiled
if embedded tests were enabled at the time of configuration.

It was also necessary to move the test_atomic target definitions in
test/Makefile.am to the --enable-embedded-tests section to avoid a
make distcheck build error.

The test case itself has been authored by smcv.

Co-authored-by: Simon McVittie <smcv@collabora.com>
5 years ago_dbus_modify_sigpipe: be thread-safe
Simon McVittie [Fri, 6 Dec 2019 01:54:18 +0000 (02:54 +0100)] 
_dbus_modify_sigpipe: be thread-safe

This needs new atomic primitives: we don't have "set to a value",
and in fact that's a bit annoying to implement in terms of gcc
intrinsics. "Set to 0" and "set to nonzero" are easy, though.

5 years agovarious: comment static variables that are locked or otherwise OK
Simon McVittie [Tue, 3 Sep 2013 11:33:37 +0000 (12:33 +0100)] 
various: comment static variables that are locked or otherwise OK

6 years agoMerge branch 'no-mapping2' into 'master'
Simon McVittie [Wed, 23 Oct 2019 11:03:16 +0000 (11:03 +0000)] 
Merge branch 'no-mapping2' into 'master'

Stop using selinux_set_mapping() function

Closes #198

See merge request dbus/dbus!128

6 years agoStop using selinux_set_mapping() function
Laurent Bigonville [Sat, 3 Mar 2018 10:15:23 +0000 (11:15 +0100)] 
Stop using selinux_set_mapping() function

Currently, if the "dbus" security class or the associated AV doesn't
exist, dbus-daemon fails to initialize and exits immediately. Also the
security classes or access vector cannot be reordered in the policy.
This can be a problem for people developing their own policy or trying
to access a machine where, for some reasons, there is not policy defined
at all.

The code here copy the behaviour of the selinux_check_access() function.
We cannot use this function here as it doesn't allow us to define the
AVC entry reference.

See the discussion at https://marc.info/?l=selinux&m=152163374332372&w=2

Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/198

6 years agoMerge branch 'fix_1' into 'master'
Ralf Habacker [Mon, 23 Sep 2019 12:50:25 +0000 (12:50 +0000)] 
Merge branch 'fix_1' into 'master'

doxygen: fix example for dbus_message_append_args

See merge request dbus/dbus!126

6 years agodoxygen: fix example for dbus_message_append_args
Felipe Franciosi [Mon, 23 Sep 2019 12:22:32 +0000 (13:22 +0100)] 
doxygen: fix example for dbus_message_append_args

Commit 724adb2f6 mangled the dbus_message_append_args() code example.
This fixes it by breaking the lines and aligning at the right places.

Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
6 years agoMerge branch '275-docs-fix' into 'master'
Simon McVittie [Mon, 19 Aug 2019 08:10:19 +0000 (08:10 +0000)] 
Merge branch '275-docs-fix' into 'master'

doc: Fix environment variable name in dbus-daemon(1)

Closes #275

See merge request dbus/dbus!122

6 years agodoc: Fix environment variable name in dbus-daemon(1)
Philip Withnall [Tue, 13 Aug 2019 14:08:03 +0000 (16:08 +0200)] 
doc: Fix environment variable name in dbus-daemon(1)

Spotted by Mubin. This documentation relates to the code in
add_bus_environment() in bus/activation.c.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #275
6 years agoMerge branch 'dbus-send-sender' into 'master'
Simon McVittie [Mon, 15 Jul 2019 12:36:50 +0000 (12:36 +0000)] 
Merge branch 'dbus-send-sender' into 'master'

dbus-send: add --sender option

See merge request dbus/dbus!116

6 years agodbus-send: add --sender option
Christopher Morin [Mon, 15 Jul 2019 12:36:50 +0000 (12:36 +0000)] 
dbus-send: add --sender option

Clients listening for a signal can match against the 'sender', expecting
it to come from a connection with a specific name. With this change,
dbus-send can send signals to them.

6 years agoUpdate NEWS
Simon McVittie [Wed, 3 Jul 2019 14:01:22 +0000 (15:01 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'break-out-more-tests' into 'master'
Simon McVittie [Wed, 3 Jul 2019 13:43:25 +0000 (13:43 +0000)] 
Merge branch 'break-out-more-tests' into 'master'

Break out more tests from libdbus

See merge request dbus/dbus!121

6 years agoMerge branch 'pass-tests-if-root' into 'master'
Simon McVittie [Wed, 3 Jul 2019 13:42:07 +0000 (13:42 +0000)] 
Merge branch 'pass-tests-if-root' into 'master'

Fix test failures when running as root

See merge request dbus/dbus!117

6 years agoMerge branch 'malloc-fail-diags' into 'master'
Simon McVittie [Wed, 3 Jul 2019 13:41:21 +0000 (13:41 +0000)] 
Merge branch 'malloc-fail-diags' into 'master'

tests: Improve diagnostics for malloc-failure tests

See merge request dbus/dbus!118

6 years agoMerge branch 'auth-idempotent' into 'master'
Simon McVittie [Wed, 3 Jul 2019 13:41:11 +0000 (13:41 +0000)] 
Merge branch 'auth-idempotent' into 'master'

auth: Clear GUID from server if out of memory

See merge request dbus/dbus!119

6 years agoMerge branch 'fdleak-diagnostics' into 'master'
Simon McVittie [Wed, 3 Jul 2019 13:40:54 +0000 (13:40 +0000)] 
Merge branch 'fdleak-diagnostics' into 'master'

Move fd-leak checking from dbus/ into test/, and improve diagnostics

See merge request dbus/dbus!120

6 years agotests: Move userdb test out of libdbus
Simon McVittie [Wed, 3 Jul 2019 10:07:07 +0000 (11:07 +0100)] 
tests: Move userdb test out of libdbus

All the functions under test turn out to be DBUS_PRIVATE_EXPORT already.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Move mempool test out of libdbus
Simon McVittie [Wed, 3 Jul 2019 09:58:06 +0000 (10:58 +0100)] 
tests: Move mempool test out of libdbus

All the functions under test turn out to be DBUS_PRIVATE_EXPORT already.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Move address test out of libdbus
Simon McVittie [Wed, 3 Jul 2019 09:47:21 +0000 (10:47 +0100)] 
tests: Move address test out of libdbus

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Move _dbus_sha_test outside libdbus
Simon McVittie [Wed, 3 Jul 2019 08:58:04 +0000 (09:58 +0100)] 
tests: Move _dbus_sha_test outside libdbus

Instead of exposing _dbus_sha_test() as a private exported symbol,
we can expose _dbus_sha_compute(), which is the only thing called by
the test that isn't already exported.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoIntroduce a new macro to export symbols solely for tests
Simon McVittie [Wed, 3 Jul 2019 09:51:26 +0000 (10:51 +0100)] 
Introduce a new macro to export symbols solely for tests

This lets us expose symbols in the embedded-tests build without
expanding the symbol table of the production library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus tests: Shut down audit socket
Simon McVittie [Sat, 29 Jun 2019 15:45:25 +0000 (16:45 +0100)] 
bus tests: Shut down audit socket

Some CI environments run build-time tests as root with CAP_AUDIT_WRITE.
In this case we need to close the audit socket so that it will not be
reported as leaked.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus: Make audit initialization idempotent
Simon McVittie [Sat, 29 Jun 2019 16:36:36 +0000 (17:36 +0100)] 
bus: Make audit initialization idempotent

The audit module is initialized every time a new BusContext is created,
which is only once in the real dbus-daemon, but can happen several times
in some unit tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Skip if unable to launch uninstalled dbus-daemon as other uid
Simon McVittie [Sat, 29 Jun 2019 14:16:03 +0000 (15:16 +0100)] 
tests: Skip if unable to launch uninstalled dbus-daemon as other uid

Some CI systems do the entire build as uid 0 in a throwaway container.
If this is done in a build directory for which the messagebus user
does not have search (+x) permission, then they will be unable to
execute the just-built dbus-daemon binary.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Skip system bus test if we are root but messagebus does not exist
Simon McVittie [Tue, 2 Jul 2019 19:42:54 +0000 (20:42 +0100)] 
tests: Skip system bus test if we are root but messagebus does not exist

Some CI systems do the build as root in a disposable container, and
run tests without ever having installed dbus. This means we can't
expect to be able to drop privileges from root to the DBUS_USER (usually
named messagebus or dbus) unless we have checked that the
DBUS_USER exists.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'doc-fix' into 'master'
Simon McVittie [Wed, 3 Jul 2019 08:28:29 +0000 (08:28 +0000)] 
Merge branch 'doc-fix' into 'master'

doc: replace dbus-send's --address with --peer and --bus

See merge request dbus/dbus!115

6 years agoApply suggestion to doc/dbus-send.1.xml.in
Christopher Morin [Wed, 3 Jul 2019 00:20:12 +0000 (00:20 +0000)] 
Apply suggestion to doc/dbus-send.1.xml.in

6 years agoApply suggestion to doc/dbus-send.1.xml.in
Christopher Morin [Tue, 2 Jul 2019 22:53:36 +0000 (22:53 +0000)] 
Apply suggestion to doc/dbus-send.1.xml.in

6 years agotests: Improve diagnostics for malloc-failure tests
Simon McVittie [Sat, 29 Jun 2019 22:34:41 +0000 (23:34 +0100)] 
tests: Improve diagnostics for malloc-failure tests

Some of these appear to hang, but making this diagnostic appear in the
log reveals the truth: it's just very slow.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoauth: Clear GUID from server if out of memory
Simon McVittie [Sat, 29 Jun 2019 16:00:02 +0000 (17:00 +0100)] 
auth: Clear GUID from server if out of memory

If we retry processing the message in response to OOM, but we don't
clear this buffer first, then the assertion at the beginning will fail.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Improve messages when fd leaks are diagnosed
Simon McVittie [Sat, 29 Jun 2019 15:15:55 +0000 (16:15 +0100)] 
tests: Improve messages when fd leaks are diagnosed

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-message-util: Fix Doxygen annotations
Simon McVittie [Sat, 29 Jun 2019 15:00:06 +0000 (16:00 +0100)] 
dbus-message-util: Fix Doxygen annotations

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMove _dbus_check_fdleaks_* from dbus-message-util to tests
Simon McVittie [Sat, 29 Jun 2019 14:59:51 +0000 (15:59 +0100)] 
Move _dbus_check_fdleaks_* from dbus-message-util to tests

This is only called from test code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodoc: replace dbus-send's --address with --peer and --bus
Chris Morin [Fri, 14 Jun 2019 03:42:37 +0000 (20:42 -0700)] 
doc: replace dbus-send's --address with --peer and --bus

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

6 years agoStart spec 0.36 development
Simon McVittie [Fri, 17 May 2019 14:47:38 +0000 (15:47 +0100)] 
Start spec 0.36 development

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoStart 1.13.14 development
Simon McVittie [Tue, 11 Jun 2019 15:28:25 +0000 (16:28 +0100)] 
Start 1.13.14 development

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoPrepare version 1.13.12 dbus-1.13.12
Simon McVittie [Sun, 9 Jun 2019 11:28:27 +0000 (12:28 +0100)] 
Prepare version 1.13.12

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Add basic test coverage for DBUS_COOKIE_SHA1
Simon McVittie [Thu, 30 May 2019 11:58:28 +0000 (12:58 +0100)] 
test: Add basic test coverage for DBUS_COOKIE_SHA1

We don't actually complete successful authentication, because that
would require us to generate a cookie and compute the correct SHA1,
which is difficult to do in a deterministic authentication script.
However, we do assert that dbus#269 (CVE-2019-12749) has been fixed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoauth: Reject DBUS_COOKIE_SHA1 for users other than the server owner
Simon McVittie [Thu, 30 May 2019 11:53:03 +0000 (12:53 +0100)] 
auth: Reject DBUS_COOKIE_SHA1 for users other than the server owner

The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership
of a shared home directory by having the server write a secret "cookie"
into a .dbus-keyrings subdirectory of the desired identity's home
directory with 0700 permissions, and having the client prove that it can
read the cookie. This never actually worked for non-malicious clients in
the case where server uid != client uid (unless the server and client
both have privileges, such as Linux CAP_DAC_OVERRIDE or traditional
Unix uid 0) because an unprivileged server would fail to write out the
cookie, and an unprivileged client would be unable to read the resulting
file owned by the server.

Additionally, since dbus 1.7.10 we have checked that ~/.dbus-keyrings
is owned by the uid of the server (a side-effect of a check added to
harden our use of XDG_RUNTIME_DIR), further ruling out successful use
by a non-malicious client with a uid differing from the server's.

Joe Vennix of Apple Information Security discovered that the
implementation of DBUS_COOKIE_SHA1 was susceptible to a symbolic link
attack: a malicious client with write access to its own home directory
could manipulate a ~/.dbus-keyrings symlink to cause the DBusServer to
read and write in unintended locations. In the worst case this could
result in the DBusServer reusing a cookie that is known to the
malicious client, and treating that cookie as evidence that a subsequent
client connection came from an attacker-chosen uid, allowing
authentication bypass.

This is mitigated by the fact that by default, the well-known system
dbus-daemon (since 2003) and the well-known session dbus-daemon (in
stable releases since dbus 1.10.0 in 2015) only accept the EXTERNAL
authentication mechanism, and as a result will reject DBUS_COOKIE_SHA1
at an early stage, before manipulating cookies. As a result, this
vulnerability only applies to:

* system or session dbus-daemons with non-standard configuration
* third-party dbus-daemon invocations such as at-spi2-core (although
  in practice at-spi2-core also only accepts EXTERNAL by default)
* third-party uses of DBusServer such as the one in Upstart

Avoiding symlink attacks in a portable way is difficult, because APIs
like openat() and Linux /proc/self/fd are not universally available.
However, because DBUS_COOKIE_SHA1 already doesn't work in practice for
a non-matching uid, we can solve this vulnerability in an easier way
without regressions, by rejecting it early (before looking at
~/.dbus-keyrings) whenever the requested identity doesn't match the
identity of the process hosting the DBusServer.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/269
Closes: CVE-2019-12749
6 years agoRevert "Start spec 0.36 development"
Simon McVittie [Sun, 9 Jun 2019 11:08:58 +0000 (12:08 +0100)] 
Revert "Start spec 0.36 development"

This reverts commit edece0274b37472d7da6db37e8afd9100d18564b.
No spec changes have happened since 0.35.

6 years agoMerge branch 'issue270' into 'master'
Simon McVittie [Fri, 31 May 2019 10:55:56 +0000 (10:55 +0000)] 
Merge branch 'issue270' into 'master'

bus: Clarify names of methods that query owned names

Closes #270

See merge request dbus/dbus!114

Reviewed-by: @pwithnall
6 years agobus: Clarify names of methods that query owned names
Simon McVittie [Thu, 30 May 2019 14:38:49 +0000 (15:38 +0100)] 
bus: Clarify names of methods that query owned names

It wasn't immediately clear from the names of these method whether they
should return TRUE or FALSE for queued owners other than the primary
owner. Renaming them makes it obvious that the answer should be TRUE.

While I'm there, make the corresponding _dbus_verbose() messages more
precise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/270

6 years agoMerge branch 'send_destination_prefix' into 'master'
Simon McVittie [Thu, 30 May 2019 14:49:09 +0000 (14:49 +0000)] 
Merge branch 'send_destination_prefix' into 'master'

Send destination prefix

See merge request dbus/dbus!85

6 years agoStart spec 0.36 development
Simon McVittie [Fri, 17 May 2019 14:47:38 +0000 (15:47 +0100)] 
Start spec 0.36 development

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoStart dbus 1.13.12 development
Simon McVittie [Fri, 17 May 2019 14:47:29 +0000 (15:47 +0100)] 
Start dbus 1.13.12 development

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodoc: described send_destination_prefix in manual
Adrian Szyndela [Fri, 26 Apr 2019 09:14:08 +0000 (11:14 +0200)] 
doc: described send_destination_prefix in manual

This adds a description of send_destination_prefix to the dbus-daemon manual.

Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
Change-Id: I46e6fa54ee34095c3ac83ec2c06cb91cf5669c7f

6 years agotest: activation tests for send_destination_prefix
Adrian Szyndela [Thu, 25 Apr 2019 13:04:53 +0000 (15:04 +0200)] 
test: activation tests for send_destination_prefix

This adds a few tests for checking if activation is allowed
for names specified within send_destination_prefix namespaces.

Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
Change-Id: I7a5a66f82fc08ce6cb46e37de2c3dfae24d9ea67

6 years agotest: send_destination(_prefix) tests
Adrian Szyndela [Thu, 25 Apr 2019 07:35:59 +0000 (09:35 +0200)] 
test: send_destination(_prefix) tests

This adds tests for mostly "send_destination_prefix" cases
and some "send_destination" cases.

The general test case is:
- addressed recipient is running and owns a name;
- a message is sent to the name owner;
- the response is checked for allow/deny (method return/error).
Each test case is executed both for primary and queued ownership.

The tests include:
- checking send allow/deny for names and namespaces, including nesting;
- checking send allow/deny for neighbour names;
- checking send allow/deny for names/namespaces+interface+member.

Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
Change-Id: If5fcada01601355e7aadefadad79c0b24f8c397f

6 years agoPrepare release v1.13.10 and Specification v0.35 dbus-1.13.10
Simon McVittie [Mon, 13 May 2019 13:24:06 +0000 (14:24 +0100)] 
Prepare release v1.13.10 and Specification v0.35

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoUpdate NEWS
Simon McVittie [Mon, 13 May 2019 11:41:53 +0000 (12:41 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'unix-gids' into 'master'
Simon McVittie [Mon, 13 May 2019 11:32:24 +0000 (11:32 +0000)] 
Merge branch 'unix-gids' into 'master'

Add UnixGroupIDs to connection credentials

See merge request dbus/dbus!105

Fixes: dbus/dbus#196
6 years agoUpdate NEWS
Simon McVittie [Mon, 13 May 2019 10:49:41 +0000 (11:49 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'cmake-mkdir' into 'master'
Ralf Habacker [Fri, 26 Apr 2019 21:48:54 +0000 (21:48 +0000)] 
Merge branch 'cmake-mkdir' into 'master'

cmake: Create all output directories for Doxygen

Closes #266

See merge request dbus/dbus!113

6 years agodbus-daemon: add send_destination_prefix support
Adrian Szyndela [Wed, 28 Nov 2018 14:15:16 +0000 (15:15 +0100)] 
dbus-daemon: add send_destination_prefix support

This extends dbus-daemon with support for send_destination_prefix
attribute in XML policies.

It allows having policy rules for sending to bus names generated
within namespaces defined by a prefix. The similar behaviour can be
emulated by owning an additional name, not used for addressing messages,
as described in
https://lists.freedesktop.org/archives/dbus/2017-May/017188.html
However, introducing send_destination_prefix creates possibility
of communicating intentions in a more direct way, which is easier
to understand.

Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
Change-Id: I0016ad93f1c16b7742fef5f45ebaf01b55694d3c

6 years agoDBusString: extend with checking for starting with words
Adrian Szyndela [Wed, 16 Jan 2019 11:30:22 +0000 (12:30 +0100)] 
DBusString: extend with checking for starting with words

This extracts a few lines of code and adds it as a DBusString function
that checks if a DBusString starts with words given with a C string
and a word separator. In other words, it checks if:
- a DBusString is a given C string, or
- a DBusString starts with a given C string and the next character is
  a given word separator.

It is used for matching names to prefixes when checking the policy.

Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
Change-Id: Ie39d33916863d950dde38d3b8b20c8a539217302

6 years agocmake: Create all output directories for Doxygen
Simon McVittie [Thu, 25 Apr 2019 11:22:13 +0000 (12:22 +0100)] 
cmake: Create all output directories for Doxygen

CI builds intermittently fail with

    error: Could not create output directory /.../doc/api/xml

or

    error: Could not create output directory /.../doc/api/man

Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/266
Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'rlimit-nofile' into 'master'
Simon McVittie [Thu, 25 Apr 2019 10:18:40 +0000 (10:18 +0000)] 
Merge branch 'rlimit-nofile' into 'master'

bus: Try to raise soft fd limit to match hard limit

See merge request dbus/dbus!103

Reviewed-by: @poettering
[smcv: Correct a comment]
Reviewed-by: @pwithnall
6 years agoMerge branch 'msys2-chmod' into 'master'
Simon McVittie [Thu, 18 Apr 2019 15:35:22 +0000 (15:35 +0000)] 
Merge branch 'msys2-chmod' into 'master'

build: Don't assume we can set permissions on a directory

Closes #216

See merge request dbus/dbus!110

6 years agobus: Try to raise soft fd limit to match hard limit
Simon McVittie [Mon, 11 Mar 2019 09:03:39 +0000 (09:03 +0000)] 
bus: Try to raise soft fd limit to match hard limit

Linux systems have traditionally set the soft limit to 1024 and the hard
limit to 4096. Recent versions of systemd keep the soft fd limit at
1024 to avoid breaking programs that still use select(), but raise the
hard limit to 512*1024, while in recent Debian versions a complicated
interaction between components gives a soft limit of 1024 and a hard
limit of 1024*1024. If we can, we might as well elevate our soft limit
to match the hard limit, minimizing the chance that we will run out of
file descriptor slots.

Unlike the previous code to raise the hard and soft limits to at least
65536, we do this even if we don't have privileges: privileges are
unnecessary to raise the soft limit up to the hard limit.

If we *do* have privileges, we also continue to raise the hard and soft
limits to at least 65536 if they weren't already that high, making
it harder to carry out a denial of service attack on the system bus on
systems that use the traditional limit (CVE-2014-7824).

As was previously the case on the system bus, we'll drop the limits back
to our initial limits before we execute a subprocess for traditional
(non-systemd) activation, if enabled.

systemd activation doesn't involve us starting subprocesses at all,
so in both cases activated services will still inherit the same limits
they did previously.

Reviewed-by: Lennart Poettering <lennart@poettering.net>
[smcv: Correct a comment based on Lennart's review, reword commit message]
Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Don't assume we can set permissions on a directory
Simon McVittie [Wed, 17 Apr 2019 15:32:01 +0000 (16:32 +0100)] 
build: Don't assume we can set permissions on a directory

MSYS2 has enough of a Unixish environment to run Autotools, but
apparently not enough of a Unixish environment to have functional
permissions.

Closes: dbus#216
6 years agoMerge branch 'disable-traditional-activation' into 'master'
Simon McVittie [Wed, 17 Apr 2019 13:33:06 +0000 (13:33 +0000)] 
Merge branch 'disable-traditional-activation' into 'master'

Configure option to disable traditional activation

See merge request dbus/dbus!107

6 years agobus_driver_credentials_fill_unix_gids: Comment on a non-error
Simon McVittie [Wed, 17 Apr 2019 13:22:15 +0000 (14:22 +0100)] 
bus_driver_credentials_fill_unix_gids: Comment on a non-error

As described in the spec, we want GetConnectionCredentials() to report
less information, successfully, if it sees a group ID that it can't
represent.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agospec: Document what happens for unrepresentable group IDs
Simon McVittie [Wed, 17 Apr 2019 13:19:15 +0000 (14:19 +0100)] 
spec: Document what happens for unrepresentable group IDs

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-dbus-daemon: Fix a misleading variable name
Simon McVittie [Wed, 17 Apr 2019 13:17:41 +0000 (14:17 +0100)] 
test-dbus-daemon: Fix a misleading variable name

In D-Bus I'd expect "ay_iter" to be an iterator over the type 'ay',
i.e. a byte-array. Abbreviate a little less to avoid this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-dbus-daemon: Say why we don't check the value of LinuxSecurityLabel
Simon McVittie [Wed, 17 Apr 2019 13:13:42 +0000 (14:13 +0100)] 
test-dbus-daemon: Say why we don't check the value of LinuxSecurityLabel

Suggested on !105 by Matthijs van Duin.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdd UnixGroupIDs to connection credentials
Matthijs van Duin [Mon, 25 Mar 2019 22:01:26 +0000 (23:01 +0100)] 
Add UnixGroupIDs to connection credentials

Signed-off-by: Matthijs van Duin <matthijsvanduin@gmail.com>
6 years agoAdd _dbus_asv_add_fixed_array
Matthijs van Duin [Mon, 25 Mar 2019 20:04:21 +0000 (21:04 +0100)] 
Add _dbus_asv_add_fixed_array

This generalizes _dbus_asv_add_byte_array.

Signed-off-by: Matthijs van Duin <matthijsvanduin@gmail.com>
6 years agoConfigure option to disable traditional activation
Topi Miettinen [Sat, 23 Mar 2019 20:18:11 +0000 (22:18 +0200)] 
Configure option to disable traditional activation

Traditional activation could be disabled if all services use
SystemdService activation instead. Provide an example of a hardened
DBus systemd service drop-in file for such a setup.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
6 years agoMerge branch 'split-spawn-oom-test' into 'master'
Simon McVittie [Fri, 15 Mar 2019 17:06:01 +0000 (17:06 +0000)] 
Merge branch 'split-spawn-oom-test' into 'master'

Split spawn oom test

See merge request dbus/dbus!99

6 years agotest-spawn-oom: Separate single spawn tests from oom related
Ralf Habacker [Fri, 15 Mar 2019 17:06:01 +0000 (17:06 +0000)] 
test-spawn-oom: Separate single spawn tests from oom related

This makes it possible to run each test independent from oom condition.

6 years agoMerge branch 'msys2-fixes' into 'master'
Simon McVittie [Fri, 15 Mar 2019 17:03:35 +0000 (17:03 +0000)] 
Merge branch 'msys2-fixes' into 'master'

cmake: Drop unused iconv dependency

Closes #262

See merge request dbus/dbus!101

6 years agoMerge branch 'cal-fix-cmake-pkgconfig' into 'master'
Ralf Habacker [Thu, 14 Mar 2019 10:57:48 +0000 (10:57 +0000)] 
Merge branch 'cal-fix-cmake-pkgconfig' into 'master'

cmake: Avoid overwriting PKG_CONFIG_PATH env var

See merge request dbus/dbus!96

Reviewed-by: @rhabacker
6 years agocmake: Avoid overwriting PKG_CONFIG_PATH env var
Clemens Lang [Fri, 8 Feb 2019 14:48:15 +0000 (15:48 +0100)] 
cmake: Avoid overwriting PKG_CONFIG_PATH env var

The CMake config file installed by DBus will run in the context of other
projects. Consequently, changing the value of the PKG_CONFIG_DIR,
PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR environment variables will affect
any further calls to pkg-config made by such projects, which can cause
problems.

A common case of this happening are pkg-config files installed in
usr/share/pkgconfig for .pc files that are architecture-independent, as
for example systemd does.

Avoid clobbering the environment variables by saving and restoring their
values. Note that for some of the variables, setting them to an empty
string is different from not setting them at all.

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
6 years agoMerge branch 'patch-1' into 'master'
Ralf Habacker [Wed, 13 Mar 2019 18:47:19 +0000 (18:47 +0000)] 
Merge branch 'patch-1' into 'master'

Update dbus-specification.xml to remove redundancies in the interface name requirements.

See merge request dbus/dbus!102

Reviewed-by: @rhabacker
6 years agoUpdate dbus-specification.xml to remove redundancies in the interface name requirements.
Felipe Gasper [Wed, 13 Mar 2019 17:26:03 +0000 (17:26 +0000)] 
Update dbus-specification.xml to remove redundancies in the interface name requirements.

6 years agoMerge branch 'fix-cmake-doc-deps' into 'master'
Ralf Habacker [Wed, 13 Mar 2019 10:04:03 +0000 (10:04 +0000)] 
Merge branch 'fix-cmake-doc-deps' into 'master'

Fixes rebuilding of dbus documentation at every make call

See merge request dbus/dbus!94

6 years agoTry to fix doxygen error on CI reporting "Output directory ... does not exist and...
Ralf Habacker [Fri, 25 Jan 2019 21:11:46 +0000 (22:11 +0100)] 
Try to fix doxygen error on CI reporting "Output directory ... does not exist and cannot be created"

6 years agoCreate top level dir for generating doxygon files
Ralf Habacker [Fri, 25 Jan 2019 20:40:49 +0000 (21:40 +0100)] 
Create top level dir for generating doxygon files

6 years agoFix dependency chain for doc files generated from docbook source
Ralf Habacker [Fri, 25 Jan 2019 18:12:32 +0000 (19:12 +0100)] 
Fix dependency chain for doc files generated from docbook source

6 years agoUpdate doxygen doc only if an associated source or Doxyfile has been changed
Ralf Habacker [Fri, 25 Jan 2019 18:05:47 +0000 (19:05 +0100)] 
Update doxygen doc only if an associated source or Doxyfile has been changed

Use doxygen.stamp as output for generating doxygen doc similar to
autotools.

6 years agoTarget devhelp2 does not require dependencies that have already been specified in...
Ralf Habacker [Fri, 25 Jan 2019 17:57:43 +0000 (18:57 +0100)] 
Target devhelp2 does not require dependencies that have already been specified in dbus.devhelp2

6 years agoCleanup dbus.devhelp2 make target pathes
Ralf Habacker [Fri, 25 Jan 2019 17:57:16 +0000 (18:57 +0100)] 
Cleanup dbus.devhelp2 make target pathes

Use absolute paths to avoid confusion about where
the associated file is located.

6 years agoAdd target devhelp2 only when xsltproc has been found
Ralf Habacker [Fri, 25 Jan 2019 17:42:16 +0000 (18:42 +0100)] 
Add target devhelp2 only when xsltproc has been found

It doesn't make sense to add a make target if it can't be created.

6 years agoMake the output directory used by doxygen absolute to avoid dependency on a particula...
Ralf Habacker [Wed, 23 Jan 2019 23:07:07 +0000 (00:07 +0100)] 
Make the output directory used by doxygen absolute to avoid dependency on a particular working directory

6 years agoMerge branch 'cmake-install-fixes' into 'master'
Ralf Habacker [Wed, 13 Mar 2019 09:48:04 +0000 (09:48 +0000)] 
Merge branch 'cmake-install-fixes' into 'master'

CMake install fixes

See merge request dbus/dbus!98

6 years agoDo not let doxygen build man pages on Windows
Ralf Habacker [Wed, 13 Mar 2019 09:13:09 +0000 (10:13 +0100)] 
Do not let doxygen build man pages on Windows

This fixes an issue on gitlab CI not been able to create man page
output dir. Also man pages does not make sense on Windows.