Commit graph

5892 commits

Author SHA1 Message Date
Simon McVittie
3ce28815e9 CI: Don't build on Debian 8 'jessie'
Debian 8 'jessie' has reached EOL for mainstream security support,
which puts it outside our usual distribution/OS support policy.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:50:02 +01:00
Simon McVittie
73cfcb95c6 CI: Build on Debian 10 'buster' by default
Previously, we built on Debian 9 'stretch' by default, and on
Debian 10 'buster' only on request. Let's reverse that so that we get
more modern toolchains, before Debian 9 'stretch' reaches EOL.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:49:19 +01:00
Simon McVittie
041cadb738 Merge branch 'coverity-354880' into 'master'
Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce() in OOM case

See merge request dbus/dbus!143
2020-03-11 13:03:34 +00:00
Ralf Habacker
00badebaac Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce() in OOM case
If there is no more memory available within the mentiond function, e.g.,
when checking memory management, the release of memory allocated by
getaddrinfo() is missing.

Coverity CID: 354880
2020-03-10 23:03:03 +01:00
Simon McVittie
bf0eaec4d9 Merge branch 'monitor-list' into 'master'
bus: Don't explicitly clear BusConnections.monitors

Closes #291

See merge request dbus/dbus!140
2020-02-25 12:49:44 +00:00
Simon McVittie
0f04661531 Merge branch 'fix-cmake-doc-build' into 'master'
Fix cmake doc build

See merge request dbus/dbus!137
2020-02-21 00:59:46 +00:00
Ralf Habacker
a094728abd cmake: Don't build dbus.devhelp2 if Doxygen is disabled
Previously this would be attempted whenever xsltproc was found, but
would fail if Doxygen documentation was disabled.
2020-02-20 20:02:30 +01:00
Simon McVittie
72911888b6 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-02-20 13:14:06 +00:00
Simon McVittie
b034b83b59 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
2020-02-20 12:43:34 +00:00
Simon McVittie
b6fd40cef9 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
2020-02-20 08:50:01 +00:00
Ralf Habacker
c0aea35e13 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
2020-02-20 08:50:00 +00:00
Simon McVittie
773f136787 Merge branch 'utf8-compliant-versioninfo' into 'master'
Transcoding template file for version information under Windows to utf-8

See merge request dbus/dbus!139
2020-02-20 08:34:04 +00:00
Ralf Habacker
2eae3d86b7 Update copyright year in file template for version info on Windows 2020-02-20 08:48:30 +01:00
Ralf Habacker
96e5cf3789 Make template file for version info under Windows utf-8 compliant 2020-02-20 08:48:30 +01:00
Simon McVittie
6dc7b49098 Merge branch 'fix-libdbus-version-info' into 'master'
Fix libdbus version info

See merge request dbus/dbus!138
2020-02-20 01:02:48 +00:00
Ralf Habacker
8ffe1b949c 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.
2020-02-19 23:41:08 +01:00
Simon McVittie
a60f4a2ca0 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
2020-02-19 20:58:16 +00:00
Ralf Habacker
2d256d42ce cmake: complete adding version info to all installed executables on Windows 2020-02-19 10:23:01 +01:00
Simon McVittie
bfad7898cc Merge branch 'master' into 'master'
cmake: add X11 include directories to tools

See merge request dbus/dbus!129
2020-01-23 11:36:21 +00:00
Tuomo Rinne
5314ced357 cmake: Add X11 include path for tools
Fixes compilation issues for case when X11 is not in a standard location
2020-01-22 21:56:53 +00:00
Ralf Habacker
5f75ed43c5 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
2019-12-13 15:20:59 +00:00
Ralf Habacker
e4feb9600e 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>
2019-12-13 16:13:53 +01:00
Simon McVittie
bf20f73873 _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.
2019-12-12 09:36:32 +01:00
Simon McVittie
4e3d6bffe2 various: comment static variables that are locked or otherwise OK 2019-12-12 09:36:24 +01:00
Simon McVittie
5c0575850f Merge branch 'no-mapping2' into 'master'
Stop using selinux_set_mapping() function

Closes #198

See merge request dbus/dbus!128
2019-10-23 11:03:16 +00:00
Laurent Bigonville
6072f8b241 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
2019-10-22 19:12:13 +02:00
Ralf Habacker
baffedbac9 Merge branch 'fix_1' into 'master'
doxygen: fix example for dbus_message_append_args

See merge request dbus/dbus!126
2019-09-23 12:50:25 +00:00
Felipe Franciosi
e6b8022ca6 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>
2019-09-23 13:22:32 +01:00
Simon McVittie
9458bd7038 Merge branch '275-docs-fix' into 'master'
doc: Fix environment variable name in dbus-daemon(1)

Closes #275

See merge request dbus/dbus!122
2019-08-19 08:10:19 +00:00
Philip Withnall
bf71a58e4a 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
2019-08-13 16:08:03 +02:00
Simon McVittie
b9e3c80d1f Merge branch 'dbus-send-sender' into 'master'
dbus-send: add --sender option

See merge request dbus/dbus!116
2019-07-15 12:36:50 +00:00
Christopher Morin
9842689a29 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.
2019-07-15 12:36:50 +00:00
Simon McVittie
1823c8e14a Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-07-03 15:01:22 +01:00
Simon McVittie
ac5cdd281a Merge branch 'break-out-more-tests' into 'master'
Break out more tests from libdbus

See merge request dbus/dbus!121
2019-07-03 13:43:25 +00:00
Simon McVittie
f73b40b883 Merge branch 'pass-tests-if-root' into 'master'
Fix test failures when running as root

See merge request dbus/dbus!117
2019-07-03 13:42:07 +00:00
Simon McVittie
b8912cf770 Merge branch 'malloc-fail-diags' into 'master'
tests: Improve diagnostics for malloc-failure tests

See merge request dbus/dbus!118
2019-07-03 13:41:21 +00:00
Simon McVittie
47148c6b55 Merge branch 'auth-idempotent' into 'master'
auth: Clear GUID from server if out of memory

See merge request dbus/dbus!119
2019-07-03 13:41:11 +00:00
Simon McVittie
379eb3a253 Merge branch 'fdleak-diagnostics' into 'master'
Move fd-leak checking from dbus/ into test/, and improve diagnostics

See merge request dbus/dbus!120
2019-07-03 13:40:54 +00:00
Simon McVittie
95db64700a 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>
2019-07-03 11:19:50 +01:00
Simon McVittie
c1412056bb 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>
2019-07-03 11:19:47 +01:00
Simon McVittie
7386456e4b tests: Move address test out of libdbus
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-07-03 11:19:19 +01:00
Simon McVittie
78d5af5ce9 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>
2019-07-03 11:18:49 +01:00
Simon McVittie
043494618e 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>
2019-07-03 11:17:27 +01:00
Simon McVittie
8421d887aa 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>
2019-07-03 11:11:23 +01:00
Simon McVittie
1b1c5ddd35 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>
2019-07-03 11:11:23 +01:00
Simon McVittie
e148aa47d3 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>
2019-07-03 11:11:23 +01:00
Simon McVittie
505bbfe4bd 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>
2019-07-03 11:11:23 +01:00
Simon McVittie
fd41caa366 Merge branch 'doc-fix' into 'master'
doc: replace dbus-send's --address with --peer and --bus

See merge request dbus/dbus!115
2019-07-03 08:28:29 +00:00
Christopher Morin
75bf56e16d Apply suggestion to doc/dbus-send.1.xml.in 2019-07-03 00:20:12 +00:00
Christopher Morin
738d5af0df Apply suggestion to doc/dbus-send.1.xml.in 2019-07-02 22:53:36 +00:00