Commit graph

6014 commits

Author SHA1 Message Date
Zeeshan Ali
ef55a3db0d Merge branch 'spec-correction' into 'master'
Add a few clarifications to the spec

See merge request dbus/dbus!203
2021-03-16 12:07:08 +00:00
Zeeshan Ali
e7db7e9390 spec: Clarify Array element needs to be padded even if inexistent 2021-03-10 12:39:27 +01:00
Zeeshan Ali
fcc3455b89 spec: Clarify that Variant's value needs padding 2021-03-10 12:39:27 +01:00
Simon McVittie
efe805c849 Merge branch 'ci' into 'master'
ci: bump msys2 deps, fix broken links

See merge request dbus/dbus!201
2021-01-13 15:05:17 +00:00
Marc-André Lureau
c5385dfd60 ci: bump msys2 deps, fix broken links
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-13 18:53:23 +04:00
Simon McVittie
95bff90369 Reference CVE-2020-35512 in NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-01-07 11:55:22 +00:00
Ralf Habacker
669e3c0aca Merge branch 'cmake-add-unit-test-macro' into 'master'
cmake: add macro add_unit_test to reduce code duplication

See merge request dbus/dbus!196
2020-12-11 09:11:31 +00:00
Ralf Habacker
b76c46437e cmake: add macro add_unit_test to reduce code duplication
This macro is now used by add_test_executable and
add_session_test_executable.
2020-11-26 10:46:34 +01:00
Ralf Habacker
2ef39181cf Merge branch 'ci-dependency-fixes' into 'master'
Cleanup package installation on CI

See merge request dbus/dbus!187
2020-11-24 07:18:19 +00:00
Ralf Habacker
6412ccdf67 tools/ci-install.sh: Use package=() style for local package list to avoid '\' notation 2020-11-24 07:08:42 +00:00
Ralf Habacker
9c5734fe90 On CI use common install prefix named 'dep_prefix' for installing local packages
With this commit a new variable 'ci_local_packages' has been introduced
to have a choice for using development packages from a local installation
or from the distribution.
2020-11-24 07:08:42 +00:00
Ralf Habacker
e82d5fe486 tools/ci-build.sh: Clean up directories from possible previous builds
Otherwise, ci-build.sh cannot be executed on a local system if there
are previous runs.
2020-11-24 07:08:42 +00:00
Ralf Habacker
478484f13c tools/ci-install.sh: merge multiple calls to apt-get
This required a reorganization of the steps that had been carried out.
The new order is:
   1. install packages with apt-get
   2. create user for build if required
   3. fetch and unpack tar balls
   4. create messagebus user
2020-11-24 07:08:42 +00:00
Ralf Habacker
1e3d82d85e Move installing packages into tools/ci-install.sh
In tools/ci-build.sh the cross compile setup has to be moved further up
to match the correct subdirectory.
2020-11-24 07:08:42 +00:00
Simon McVittie
f009dad5fb Merge branch 'misc-windows-fixes' into 'master'
sysdeps-win: Expand/fix verbose logging

See merge request dbus/dbus!193
2020-11-23 14:45:32 +00:00
Ralf Habacker
7ec42d28fc _dbus_poll_select (): fix concating multiple verbose lines 2020-11-23 14:21:51 +00:00
Ralf Habacker
4634d20ef1 Add verbose info to publishing session bus related functions
This is useful for tracking auto launch support in dbus-daemon.
2020-11-23 14:21:51 +00:00
Simon McVittie
c7ad138a21 Merge branch 'update-selinux-auditing' into 'master'
bus/selinux: Fix audit message types.

See merge request dbus/dbus!173
2020-11-23 13:23:12 +00:00
Chris PeBenito
2d5d40d5a5 bus/selinux: Fix audit message types.
The SELinux log callback includes a message type. Not all messages are
auditable and those that are have varying audit types. An audit message is
a security-relevant event: security state changes, MAC permission denied,
etc.  A message that is auditable is not necessarily sensitive.  Messages
that are not auditable are not security-relevant, like messages about
socket polling errors.  Update the auditing accordingly.

If the message is not auditable, fall through and write it to syslog.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-11-23 13:07:19 +00:00
Simon McVittie
8e028f2002 Merge branch 'travis-ci-cleanup' into 'master'
Drop unused travis CI configuration files

See merge request dbus/dbus!197
2020-11-23 12:06:10 +00:00
Ralf Habacker
2534c2076f Drop unused travis CI configuration files 2020-11-16 14:48:59 +01:00
Simon McVittie
75a9cd0827 Merge branch 'bug/NEWS-machine-id-paths' into 'master'
NEWS: Add missing directory 'lib' to three paths

See merge request dbus/dbus!182
2020-11-09 15:00:39 +00:00
Samy Mahmoudi
95ad63d706 NEWS: Add missing directory 'lib' to three paths
Since ${localstatedir}/dbus should be ${localstatedir}/lib/dbus,
insert the missing directory 'lib' into the three erroneous paths.
2020-11-06 22:39:55 +00:00
Simon McVittie
b187a5f729 Merge branch 'macos-x11-bugfix' into 'master'
dbus-launch: Replace slashes in DISPLAY if present

Closes #8 and #311

See merge request dbus/dbus!180
2020-11-06 17:26:28 +00:00
William Earley
3545d0f4de dbus-launch: Replace slashes in DISPLAY if present
dbus-daemon fails to autolaunch with X11 on macOS 10.8+ because XQuartz
(the X11 package for macOS) provides a value for `$DISPLAY` that is
not expected by dbus, in that it contains `/` characters. This is
addressed by replacing the invalid path character `/` with `_`.

Resolves: #8
Resolves: #311
2020-11-06 17:17:09 +00:00
Simon McVittie
895ef72bc0 Merge branch 'macos-setrlimit-bugfix' into 'master'
sysdeps: Don't raise RLIMIT_NOFILE beyond OPEN_MAX on macOS

Closes #309

See merge request dbus/dbus!178
2020-11-06 15:20:51 +00:00
William Earley
691946dabc sysdeps: Don't raise RLIMIT_NOFILE beyond OPEN_MAX on macOS
dbus-daemon fails to launch on macOS 10.5 and above because of a breaking
change in setrlimit, in which RLIM_INFINITY is no longer supported
for RLIMIT_NOFILE. Instead we must use OPEN_MAX.

Resolves: #309
2020-11-06 15:10:42 +00:00
Simon McVittie
49d924ba56 Merge branch 'docs-generate-reproducible-ids' into 'master'
docs: generate reproducible ids

See merge request dbus/dbus!189
2020-11-06 14:01:46 +00:00
Arnout Engelen
43e0188dbf
docs: generate reproducible ids
With this parameter, docbook will generate the same id's when generating the
same docs. This is helpful to get bit-by-bit 'reproducible' output, which
makes auditing the package easier.

Tested both the cmake output and the automake output
2020-11-06 14:52:48 +01:00
Simon McVittie
5db5415810 Merge branch 'wip/update-msys-packages' into 'master'
ci-build: Update required MSYS packages

Closes #318

See merge request dbus/dbus!190
2020-11-06 13:51:17 +00:00
Simon McVittie
053238254e ci-build: Update required MSYS packages
The older versions we were previously building against are no longer
available on mirrors.

Based on changes proposed in !189 by Arnout Engelen, and the package
list gathered by Ralf Habacker in #318.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/318
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-11-06 13:38:45 +00:00
Simon McVittie
0686f7bb16 Merge branch 'patch-1' into 'master'
doc: Fix typo in dbus-daemon(1)

See merge request dbus/dbus!183
2020-10-19 19:49:03 +00:00
Chigozirim Chukwu
72dd2923d0 doc: Fix typo in dbus-daemon(1) 2020-10-19 18:38:09 +00:00
Simon McVittie
2285db23ce Merge branch 'glibc' into 'master'
disable fork-malloc-exec for non-glibc-systems

See merge request dbus/dbus!181
2020-09-28 13:42:55 +00:00
Jean-Louis Fuchs
3fab06d68f
disable fork-malloc-exec for non-glibc-systems
Calling malloc() after fork is undefined behaviour if the process is
multi-threaded. locks held by a thread on fork() will never be released.
malloc() is usally protected by a lock and can therefore deadlock. glibc
is known not to deadlock in this case.

This commit does not rule out other problems on glibc-systems, but fixes an
issue on musl-libc-systems. Only restricting to async-signal safe functions
between fork() and exec() prevents undefined behaviour for sure. See
signal-safety(7).
2020-09-28 15:18:12 +02:00
Simon McVittie
bf51a3169c Merge branch 'cmake-enable-traditional-activation' into 'master'
CMake: allow traditional activation to be disabled

See merge request dbus/dbus!159
2020-09-24 10:48:47 +00:00
Ralf Habacker
5b1870a5bd cmake: make support for traditional activation optional
Traditional activation is enabled/disabled with the cmake configure
parameter -DENABLE_TRADITIONAL_ACTIVATION, which is enabled by default.

This was added to the Autotools build system as part of dbus/dbus!107
but until now was not possible to disable when building with CMake.
2020-09-23 17:21:40 +02:00
Ralf Habacker
82942171a8 Merge branch 'cmake-fixup' into 'master'
cmake: move up checking DBUS_ENABLE_EMBEDDED_TESTS from subdir test/name-test to test

See merge request dbus/dbus!177
2020-09-23 15:02:08 +00:00
Ralf Habacker
b698fb7639 cmake: move up checking DBUS_ENABLE_EMBEDDED_TESTS from subdir test/name-test to test
The whole file is only added with the mentioned variable
set, so it can also be skipped completly one level up.
2020-09-23 14:27:53 +00:00
Simon McVittie
bc7123534d Merge branch 'install-ddlh' into 'master'
cmake: install dbus-daemon-launch-helper

Closes #310

See merge request dbus/dbus!175
2020-09-23 14:18:48 +00:00
Ralf Habacker
2148a5a803 cmake: install dbus-daemon-launch-helper on Unix
Previously it was built on Unix platforms, but not installed. This
would prevent traditional activation on the system bus (on Linux
without systemd or non-Linux, or for services without SystemdService),
which requires the activation helper.

Because the executable is an internal implementation detail of how
traditional activation is implemented on Unix, it is not exported to
the generated cmake support files.

Resolves: dbus#310
2020-09-22 11:22:40 +02:00
Simon McVittie
e8dc63c041 Merge branch 'spec-cookie-timeouts' into 'master'
spec: Update recommendations for DBUS_COOKIE_SHA1 timeouts

See merge request dbus/dbus!171
2020-09-21 11:23:25 +00:00
Simon McVittie
3f8b2ce52e spec: Update recommendations for DBUS_COOKIE_SHA1 timeouts
This had two issues that could damage interoperability.

First, the spec wording suggested that any cookie that had not been
deleted was suitable for use in authentication. However, this introduces
a race condition, which is called out in comments in both the reference
implementation and GDBus: the newest cookie might be less old than the
arbitrary lifetime when authentication *begins*, but older than the
lifetime at the time authentication *ends*. As a result, we need a grace
period during which an old cookie will still be accepted, but a newer
cookie exists and will be used for new authentication operations.

Second, the spec wording implied that the arbitrary timeouts were
completely up to the implementor. However, GLib bug
https://gitlab.gnome.org/GNOME/glib/-/issues/2164 indicates that they
need to be reasonably compatible: in particular, GDBus servers
historically didn't allocate new cookies until 10 minutes had passed,
but libdbus clients would decline to use a cookie older than 5 minutes,
causing authentication to fail if the gdbus-server test-case (in which
GDBus and libdbus clients connect to a GDBus server) happened to take
longer than 5 minutes to run.

While I'm here, also be consistent about calling the secrets "cookies"
(consistent with the name of the mechanism) rather than "keys" (which
is what they are called in libdbus' dbus-keyring.c).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-09-07 11:03:00 +00:00
Simon McVittie
58d71b797d Merge branch 'glib-tests-on-freebsd' into 'master'
tests: On Unix, include <netinet/in.h> for IPPROTO_TCP

See merge request dbus/dbus!167
2020-08-19 14:28:04 +00:00
Simon McVittie
f0e526bca8 tests: On Unix, include <netinet/in.h> for IPPROTO_TCP
Otherwise, dbus doesn't compile on FreeBSD if the GLib-based tests
are enabled (which suggests that no FreeBSD user has run those tests
successfully).

We already include <netinet/in.h> in other places with no conditions
or checks other than "is Unix", so apparently it's portable enough that
specifically testing for its presence is not necessary. POSIX requires it
to exist.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-08-14 17:02:46 +01:00
Simon McVittie
c91ca6edad v1.13.18
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-07-02 11:09:48 +01:00
Simon McVittie
00e7beaac2 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-07-02 10:24:55 +01:00
Simon McVittie
e75c67a28f Merge branch 'issue305' into 'master'
userdb: Reference-count DBusUserInfo, DBusGroupInfo

Closes #305

See merge request dbus/dbus!166
2020-07-01 13:29:39 +00:00
Simon McVittie
2b7948ef90 userdb: Reference-count DBusUserInfo, DBusGroupInfo
Previously, the hash table indexed by uid (or gid) took ownership of the
single reference to the heap-allocated struct, and the hash table
indexed by username (or group name) had a borrowed pointer to the same
struct that exists in the other hash table.

However, this can break down if you have two or more distinct usernames
that share a numeric identifier. This is generally a bad idea, because
the user-space model in such situations does not match the kernel-space
reality, and in particular there is no effective kernel-level security
boundary between such users, but it is sometimes done anyway.

In this case, when the second username is looked up in the userdb, it
overwrites (replaces) the entry in the hash table that is indexed by
uid, freeing the DBusUserInfo. This results in both the key and the
value in the hash table that is indexed by username becoming dangling
pointers (use-after-free), leading to undefined behaviour, which is
certainly not what we want to see when doing access control.

An equivalent situation can occur with groups, in the rare case where
a numeric group ID has two names (although I have not heard of this
being done in practice).

Solve this by reference-counting the data structure. There are up to
three references in practice: one held temporarily while the lookup
function is populating and storing it, one held by the hash table that
is indexed by uid, and one held by the hash table that is indexed by
name.

Closes: dbus#305
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-07-01 13:21:23 +01:00
Simon McVittie
6ee66ff7bc userdb: Make lookups return a const pointer
This makes it more obvious that the returned pointer points to a
struct owned by the userdb, which must not be freed or have its
contents modified, and is only valid to dereference until the next
modification to the userdb's underlying hash tables (which in practice
means until the lock is released, because after that we have no
guarantees about what might be going on in another thread).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-06-30 19:13:17 +01:00