]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
4 years agodbus-sysdeps-win.c: Add helper functions to handle events on Windows
Ralf Habacker [Fri, 29 Oct 2021 11:02:13 +0000 (13:02 +0200)] 
dbus-sysdeps-win.c: Add helper functions to handle events on Windows

These functions are in the dbus library to be used everywhere

4 years agoMerge branch 'remove-nonexistent-match' into 'master'
Simon McVittie [Mon, 22 Nov 2021 18:06:44 +0000 (18:06 +0000)] 
Merge branch 'remove-nonexistent-match' into 'master'

bus: Don't return success from RemoveMatch if there was no such match-rule

See merge request dbus/dbus!222

4 years agotest: Exercise successful and failed RemoveMatch calls
Simon McVittie [Mon, 22 Nov 2021 15:58:40 +0000 (15:58 +0000)] 
test: Exercise successful and failed RemoveMatch calls

Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/351
Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agobus: Separate RemoveMatch into prepare and commit stages
Simon McVittie [Mon, 22 Nov 2021 16:01:58 +0000 (16:01 +0000)] 
bus: Separate RemoveMatch into prepare and commit stages

This means we don't send a spurious successful reply if a caller removes
a match rule that they never added.

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoMerge branch 'cleanup-autolaunch-win' into 'master'
Simon McVittie [Fri, 19 Nov 2021 12:14:59 +0000 (12:14 +0000)] 
Merge branch 'cleanup-autolaunch-win' into 'master'

dbus-sysdeps-win.c: corrections of indentations and minor refactoring

See merge request dbus/dbus!221

4 years agodbus/dbus-sysdeps-win.c: Convert the character buffer 'dbus_args' to a DBusString...
Ralf Habacker [Tue, 17 Dec 2019 12:43:40 +0000 (13:43 +0100)] 
dbus/dbus-sysdeps-win.c: Convert the character buffer 'dbus_args' to a DBusString instance

This is necessary to avoid possible stack overflows.

4 years agodbus/dbus-sysdeps-*win.c: correct indentation when calling functions
Ralf Habacker [Tue, 24 Nov 2020 07:25:58 +0000 (08:25 +0100)] 
dbus/dbus-sysdeps-*win.c: correct indentation when calling functions

The normal style is <function-name><space>(<no-spaces>...<no-spaces>).

4 years agodbus/dbus-sysdeps-win.c: correction of indentations in _dbus_get_autolaunch_address ()
Ralf Habacker [Tue, 17 Dec 2019 12:21:03 +0000 (13:21 +0100)] 
dbus/dbus-sysdeps-win.c: correction of indentations in _dbus_get_autolaunch_address ()

4 years agoMerge branch 'cmake-fix-include-path' into 'master'
Ralf Habacker [Thu, 18 Nov 2021 15:12:13 +0000 (15:12 +0000)] 
Merge branch 'cmake-fix-include-path' into 'master'

cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS from related cmake target

Closes #346

See merge request dbus/dbus!214

4 years agocmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS variable...
Ralf Habacker [Mon, 1 Nov 2021 12:01:59 +0000 (13:01 +0100)] 
cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS variable from related cmake target

This allows cmake to construct the resulting (relocatable) runtime paths.

Fixes dbus/dbus#346

4 years agoMerge branch 'master' into 'master'
Ralf Habacker [Thu, 18 Nov 2021 13:20:22 +0000 (13:20 +0000)] 
Merge branch 'master' into 'master'

CMake: Set IMPORTED_IMPLIB property

See merge request dbus/dbus!172

4 years agoCMake: Set IMPORTED_IMPLIB property
Julien Schueller [Sat, 12 Sep 2020 09:42:35 +0000 (09:42 +0000)] 
CMake: Set IMPORTED_IMPLIB property

Setting this property allows to fix linking to the imported target with MinGW.
This only happens when dbus is built using autotools, when cmake is used the DBus1Config.variant.in
is configured and the automatically exported target by cmake is fine.

4 years agoMerge branch 'cmake-build-fixes' into 'master'
Simon McVittie [Thu, 18 Nov 2021 13:09:14 +0000 (13:09 +0000)] 
Merge branch 'cmake-build-fixes' into 'master'

cmake: various variable corrections defined in the generated config.h

See merge request dbus/dbus!217

4 years agocmake: Separate setting compiler warnings between C and CXX
Ralf Habacker [Wed, 17 Nov 2021 08:35:11 +0000 (09:35 +0100)] 
cmake: Separate setting compiler warnings between C and CXX

This is necessary because different warnings are restricted to one
compiler variant.

4 years agoAdd HAVE_DECL_xxx checks to cmake build system
Ralf Habacker [Tue, 8 Jan 2019 08:33:41 +0000 (09:33 +0100)] 
Add HAVE_DECL_xxx checks to cmake build system

The first two definitions are required to fix cmake build error when
compiling with -Werror=undef on Windows.

The last one completes having HAVE_DECL_xxx definitions.

4 years agoMove _GNU_SOURCE to config.h.cmake
Ralf Habacker [Tue, 16 Oct 2018 20:47:18 +0000 (22:47 +0200)] 
Move _GNU_SOURCE to config.h.cmake

4 years agoMove DBUS_BUILT_R_DYNAMIC to config.h.cmake
Ralf Habacker [Sun, 21 Oct 2018 13:18:50 +0000 (15:18 +0200)] 
Move DBUS_BUILT_R_DYNAMIC to config.h.cmake

4 years agoFix definition of HAVE_SOCKLEN_T
Ralf Habacker [Wed, 3 Nov 2021 08:37:04 +0000 (09:37 +0100)] 
Fix definition of HAVE_SOCKLEN_T

4 years agoAdd configure checks for vsnprintf and vasprintf to cmake build system
Ralf Habacker [Wed, 3 Nov 2021 08:35:24 +0000 (09:35 +0100)] 
Add configure checks for vsnprintf and vasprintf to cmake build system

4 years agocmake: take over some fatal warnings from autotools
Ralf Habacker [Thu, 11 Nov 2021 12:24:06 +0000 (13:24 +0100)] 
cmake: take over some fatal warnings from autotools

Adopt various fatal warnings from the autotools build system
to see corresponding build errors also in cmake.

4 years agoMerge branch 'davidre-master-patch-89698' into 'master'
Simon McVittie [Thu, 18 Nov 2021 11:46:30 +0000 (11:46 +0000)] 
Merge branch 'davidre-master-patch-89698' into 'master'

Put dbus-daemon into session slice

See merge request dbus/dbus!219

4 years agoPut dbus-daemon into session slice
David Redondo [Wed, 17 Nov 2021 12:24:19 +0000 (12:24 +0000)] 
Put dbus-daemon into session slice

The session slice and the  app and background slices are special slices defined by
https://systemd.io/DESKTOP_ENVIRONMENTS/, where:
  session.slice: Contains only processes essential to run the user’s graphical session
  app.slice: Contains all normal applications that the user is running
This allows users or sysadmins to control resource allocation depending on the type
of the service.
Since v249 (https://github.com/systemd/systemd/commit/23dce98e89616092007005692a4574ab908db5a6)
systemd puts user services into the app slice by default so dbus needs to manually state
that it belongs in the session slice.

4 years agoMerge branch 'fix-319' into 'master'
Ralf Habacker [Thu, 18 Nov 2021 11:02:32 +0000 (11:02 +0000)] 
Merge branch 'fix-319' into 'master'

cmake: fix find_package related naming mismatch for GLIB2

Closes #319

See merge request dbus/dbus!216

4 years agocmake: fix find_package related naming mismatch for GLIB2
Ralf Habacker [Tue, 9 Nov 2021 23:49:21 +0000 (00:49 +0100)] 
cmake: fix find_package related naming mismatch for GLIB2

The package name passed to `find_package_handle_standard_args` (GLIB2) did not match the name of the calling package (GLib2).
This could lead to problems when calling code that expects `find_package`.
result variables (e.g. `_FOUND`) expect to follow a certain pattern.

fixes #319

4 years agoMerge branch 'fix-spec' into 'master'
Simon McVittie [Tue, 9 Nov 2021 12:46:03 +0000 (12:46 +0000)] 
Merge branch 'fix-spec' into 'master'

spec: Clean up use of the term for an array of dict entries

Closes #347

See merge request dbus/dbus!215

4 years agoClean up use of the term for an array of dict entries
Ralf Habacker [Mon, 8 Nov 2021 23:01:46 +0000 (00:01 +0100)] 
Clean up use of the term for an array of dict entries

fixes #347

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
4 years agoStart spec 0.37 development
Ralf Habacker [Mon, 8 Nov 2021 13:22:42 +0000 (14:22 +0100)] 
Start spec 0.37 development

4 years agoMerge branch 'get-machine-id' into 'master'
Simon McVittie [Fri, 29 Oct 2021 18:24:11 +0000 (18:24 +0000)] 
Merge branch 'get-machine-id' into 'master'

Specify what ID GetMachineId actually returns

See merge request dbus/dbus!198

4 years agoDescribe where machine ID comes from
Thomas Kluyver [Fri, 29 Oct 2021 18:24:11 +0000 (18:24 +0000)] 
Describe where machine ID comes from

4 years agoMerge branch 'test-memleak' into 'master'
Simon McVittie [Fri, 29 Oct 2021 18:12:16 +0000 (18:12 +0000)] 
Merge branch 'test-memleak' into 'master'

test/thread-blocking.c: Fix a memory leak

See merge request dbus/dbus!208

4 years agotest/thread-blocking.c: Fix a memory leak
David King [Thu, 20 May 2021 07:58:13 +0000 (08:58 +0100)] 
test/thread-blocking.c: Fix a memory leak

Free name inside the for loop. Found by Coverity.

Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1938701

4 years agoMerge branch 'cmake-format-fixes' into 'master'
Simon McVittie [Fri, 29 Oct 2021 16:29:45 +0000 (16:29 +0000)] 
Merge branch 'cmake-format-fixes' into 'master'

CMake-format fixes

See merge request dbus/dbus!213

4 years agoApply cmake formatting rules
Ralf Habacker [Mon, 25 Oct 2021 13:56:46 +0000 (15:56 +0200)] 
Apply cmake formatting rules

4 years agotools/cmake-format: fix sed warning `Expression #1, char 25: unknown option for ...
Ralf Habacker [Mon, 25 Oct 2021 13:56:09 +0000 (15:56 +0200)] 
tools/cmake-format: fix sed warning `Expression #1, char 25: unknown option for »s«` in --all mode

4 years agotools/cmake-format: add support to use custom source root directory
Ralf Habacker [Mon, 25 Oct 2021 13:42:37 +0000 (15:42 +0200)] 
tools/cmake-format: add support to use custom source root directory

4 years agoMerge branch 'dbus-send-validate' into 'master'
Simon McVittie [Mon, 19 Jul 2021 12:27:16 +0000 (12:27 +0000)] 
Merge branch 'dbus-send-validate' into 'master'

dbus-send: Do more syntax validation

Closes #338

See merge request dbus/dbus!211

4 years agodbus-send: Validate interface, member names before use
Simon McVittie [Mon, 21 Jun 2021 11:04:05 +0000 (12:04 +0100)] 
dbus-send: Validate interface, member names before use

Instead of a failed check or assertion failure and a core dump, let's
produce an error message on stderr and a graceful nonzero exit status.
It's still not going to *work*, but at least we can avoid crashing.

    $ dbus-send / com.example.Nope..Nope
    Interface name was not valid: 'com.example.Nope.'
    $ dbus-send / com.example.Nope.0
    Invalid signal name: Member name was not valid: '0'

Resolves: dbus#338
Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agodbus-send: Print an error message if object path is syntactically invalid
Simon McVittie [Mon, 21 Jun 2021 11:02:27 +0000 (12:02 +0100)] 
dbus-send: Print an error message if object path is syntactically invalid

    $ dbus-send // nope
    Object path was not valid: '//'

Related to dbus#338.

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoMerge branch 'spec-correction' into 'master' 34/merge
Zeeshan Ali [Tue, 16 Mar 2021 12:07:08 +0000 (12:07 +0000)] 
Merge branch 'spec-correction' into 'master'

Add a few clarifications to the spec

See merge request dbus/dbus!203

4 years agospec: Clarify Array element needs to be padded even if inexistent
Zeeshan Ali [Wed, 24 Feb 2021 11:34:08 +0000 (12:34 +0100)] 
spec: Clarify Array element needs to be padded even if inexistent

4 years agospec: Clarify that Variant's value needs padding
Zeeshan Ali [Wed, 24 Feb 2021 11:16:08 +0000 (12:16 +0100)] 
spec: Clarify that Variant's value needs padding

4 years agoMerge branch 'ci' into 'master'
Simon McVittie [Wed, 13 Jan 2021 15:05:17 +0000 (15:05 +0000)] 
Merge branch 'ci' into 'master'

ci: bump msys2 deps, fix broken links

See merge request dbus/dbus!201

4 years agoci: bump msys2 deps, fix broken links
Marc-André Lureau [Sun, 10 Jan 2021 18:54:43 +0000 (22:54 +0400)] 
ci: bump msys2 deps, fix broken links

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 years agoReference CVE-2020-35512 in NEWS
Simon McVittie [Thu, 7 Jan 2021 11:55:19 +0000 (11:55 +0000)] 
Reference CVE-2020-35512 in NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years agoMerge branch 'cmake-add-unit-test-macro' into 'master'
Ralf Habacker [Fri, 11 Dec 2020 09:11:31 +0000 (09:11 +0000)] 
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

5 years agocmake: add macro add_unit_test to reduce code duplication
Ralf Habacker [Sat, 14 Nov 2020 11:30:32 +0000 (12:30 +0100)] 
cmake: add macro add_unit_test to reduce code duplication

This macro is now used by add_test_executable and
add_session_test_executable.

5 years agoMerge branch 'ci-dependency-fixes' into 'master'
Ralf Habacker [Tue, 24 Nov 2020 07:18:19 +0000 (07:18 +0000)] 
Merge branch 'ci-dependency-fixes' into 'master'

Cleanup package installation on CI

See merge request dbus/dbus!187

5 years agotools/ci-install.sh: Use package=() style for local package list to avoid '\' notation
Ralf Habacker [Tue, 10 Nov 2020 22:35:16 +0000 (23:35 +0100)] 
tools/ci-install.sh: Use package=() style for local package list to avoid '\' notation

5 years agoOn CI use common install prefix named 'dep_prefix' for installing local packages
Ralf Habacker [Mon, 9 Nov 2020 09:58:22 +0000 (10:58 +0100)] 
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.

5 years agotools/ci-build.sh: Clean up directories from possible previous builds
Ralf Habacker [Mon, 9 Nov 2020 10:06:14 +0000 (11:06 +0100)] 
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.

5 years agotools/ci-install.sh: merge multiple calls to apt-get
Ralf Habacker [Fri, 6 Nov 2020 11:08:12 +0000 (12:08 +0100)] 
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

5 years agoMove installing packages into tools/ci-install.sh
Ralf Habacker [Fri, 6 Nov 2020 08:45:40 +0000 (09:45 +0100)] 
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.

5 years agoMerge branch 'misc-windows-fixes' into 'master'
Simon McVittie [Mon, 23 Nov 2020 14:45:32 +0000 (14:45 +0000)] 
Merge branch 'misc-windows-fixes' into 'master'

sysdeps-win: Expand/fix verbose logging

See merge request dbus/dbus!193

5 years ago_dbus_poll_select (): fix concating multiple verbose lines
Ralf Habacker [Tue, 5 May 2020 22:28:04 +0000 (00:28 +0200)] 
_dbus_poll_select (): fix concating multiple verbose lines

5 years agoAdd verbose info to publishing session bus related functions
Ralf Habacker [Tue, 5 Feb 2019 15:13:42 +0000 (16:13 +0100)] 
Add verbose info to publishing session bus related functions

This is useful for tracking auto launch support in dbus-daemon.

5 years agoMerge branch 'update-selinux-auditing' into 'master'
Simon McVittie [Mon, 23 Nov 2020 13:23:12 +0000 (13:23 +0000)] 
Merge branch 'update-selinux-auditing' into 'master'

bus/selinux: Fix audit message types.

See merge request dbus/dbus!173

5 years agobus/selinux: Fix audit message types.
Chris PeBenito [Mon, 14 Sep 2020 15:34:04 +0000 (11:34 -0400)] 
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>
5 years agoMerge branch 'travis-ci-cleanup' into 'master'
Simon McVittie [Mon, 23 Nov 2020 12:06:10 +0000 (12:06 +0000)] 
Merge branch 'travis-ci-cleanup' into 'master'

Drop unused travis CI configuration files

See merge request dbus/dbus!197

5 years agoDrop unused travis CI configuration files
Ralf Habacker [Tue, 10 Nov 2020 18:57:18 +0000 (19:57 +0100)] 
Drop unused travis CI configuration files

5 years agoMerge branch 'bug/NEWS-machine-id-paths' into 'master'
Simon McVittie [Mon, 9 Nov 2020 15:00:39 +0000 (15:00 +0000)] 
Merge branch 'bug/NEWS-machine-id-paths' into 'master'

NEWS: Add missing directory 'lib' to three paths

See merge request dbus/dbus!182

5 years agoNEWS: Add missing directory 'lib' to three paths
Samy Mahmoudi [Thu, 5 Nov 2020 23:13:23 +0000 (18:13 -0500)] 
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.

5 years agoMerge branch 'macos-x11-bugfix' into 'master'
Simon McVittie [Fri, 6 Nov 2020 17:26:28 +0000 (17:26 +0000)] 
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

5 years agodbus-launch: Replace slashes in DISPLAY if present
William Earley [Sun, 27 Sep 2020 11:39:04 +0000 (12:39 +0100)] 
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

5 years agoMerge branch 'macos-setrlimit-bugfix' into 'master'
Simon McVittie [Fri, 6 Nov 2020 15:20:51 +0000 (15:20 +0000)] 
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

5 years agosysdeps: Don't raise RLIMIT_NOFILE beyond OPEN_MAX on macOS
William Earley [Sun, 27 Sep 2020 11:24:30 +0000 (12:24 +0100)] 
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

5 years agoMerge branch 'docs-generate-reproducible-ids' into 'master'
Simon McVittie [Fri, 6 Nov 2020 14:01:46 +0000 (14:01 +0000)] 
Merge branch 'docs-generate-reproducible-ids' into 'master'

docs: generate reproducible ids

See merge request dbus/dbus!189

5 years agodocs: generate reproducible ids
Arnout Engelen [Thu, 5 Nov 2020 20:27:02 +0000 (21:27 +0100)] 
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

5 years agoMerge branch 'wip/update-msys-packages' into 'master'
Simon McVittie [Fri, 6 Nov 2020 13:51:17 +0000 (13:51 +0000)] 
Merge branch 'wip/update-msys-packages' into 'master'

ci-build: Update required MSYS packages

Closes #318

See merge request dbus/dbus!190

5 years agoci-build: Update required MSYS packages
Simon McVittie [Fri, 6 Nov 2020 13:38:45 +0000 (13:38 +0000)] 
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>
5 years agoMerge branch 'patch-1' into 'master'
Simon McVittie [Mon, 19 Oct 2020 19:49:03 +0000 (19:49 +0000)] 
Merge branch 'patch-1' into 'master'

doc: Fix typo in dbus-daemon(1)

See merge request dbus/dbus!183

5 years agodoc: Fix typo in dbus-daemon(1)
Chigozirim Chukwu [Mon, 19 Oct 2020 18:38:09 +0000 (18:38 +0000)] 
doc: Fix typo in dbus-daemon(1)

5 years agoMerge branch 'glibc' into 'master'
Simon McVittie [Mon, 28 Sep 2020 13:42:55 +0000 (13:42 +0000)] 
Merge branch 'glibc' into 'master'

disable fork-malloc-exec for non-glibc-systems

See merge request dbus/dbus!181

5 years agodisable fork-malloc-exec for non-glibc-systems
Jean-Louis Fuchs [Mon, 28 Sep 2020 12:45:15 +0000 (14:45 +0200)] 
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).

5 years agoMerge branch 'cmake-enable-traditional-activation' into 'master'
Simon McVittie [Thu, 24 Sep 2020 10:48:47 +0000 (10:48 +0000)] 
Merge branch 'cmake-enable-traditional-activation' into 'master'

CMake: allow traditional activation to be disabled

See merge request dbus/dbus!159

5 years agocmake: make support for traditional activation optional
Ralf Habacker [Wed, 23 Sep 2020 14:32:54 +0000 (16:32 +0200)] 
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.

5 years agoMerge branch 'cmake-fixup' into 'master'
Ralf Habacker [Wed, 23 Sep 2020 15:02:08 +0000 (15:02 +0000)] 
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

5 years agocmake: move up checking DBUS_ENABLE_EMBEDDED_TESTS from subdir test/name-test to...
Ralf Habacker [Mon, 27 Apr 2020 18:24:57 +0000 (20:24 +0200)] 
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.

5 years agoMerge branch 'install-ddlh' into 'master'
Simon McVittie [Wed, 23 Sep 2020 14:18:48 +0000 (14:18 +0000)] 
Merge branch 'install-ddlh' into 'master'

cmake: install dbus-daemon-launch-helper

Closes #310

See merge request dbus/dbus!175

5 years agocmake: install dbus-daemon-launch-helper on Unix
Ralf Habacker [Mon, 21 Sep 2020 12:36:24 +0000 (14:36 +0200)] 
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

5 years agoMerge branch 'spec-cookie-timeouts' into 'master'
Simon McVittie [Mon, 21 Sep 2020 11:23:25 +0000 (11:23 +0000)] 
Merge branch 'spec-cookie-timeouts' into 'master'

spec: Update recommendations for DBUS_COOKIE_SHA1 timeouts

See merge request dbus/dbus!171

5 years agospec: Update recommendations for DBUS_COOKIE_SHA1 timeouts
Simon McVittie [Mon, 7 Sep 2020 10:57:19 +0000 (11:57 +0100)] 
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>
5 years agoMerge branch 'glib-tests-on-freebsd' into 'master'
Simon McVittie [Wed, 19 Aug 2020 14:28:04 +0000 (14:28 +0000)] 
Merge branch 'glib-tests-on-freebsd' into 'master'

tests: On Unix, include <netinet/in.h> for IPPROTO_TCP

See merge request dbus/dbus!167

5 years agotests: On Unix, include <netinet/in.h> for IPPROTO_TCP
Simon McVittie [Wed, 1 Jul 2020 15:01:38 +0000 (16:01 +0100)] 
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>
5 years agov1.13.18 dbus-1.13.18
Simon McVittie [Thu, 2 Jul 2020 10:09:48 +0000 (11:09 +0100)] 
v1.13.18

Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years agoUpdate NEWS
Simon McVittie [Thu, 2 Jul 2020 09:24:55 +0000 (10:24 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years agoMerge branch 'issue305' into 'master'
Simon McVittie [Wed, 1 Jul 2020 13:29:39 +0000 (13:29 +0000)] 
Merge branch 'issue305' into 'master'

userdb: Reference-count DBusUserInfo, DBusGroupInfo

Closes #305

See merge request dbus/dbus!166

5 years agouserdb: Reference-count DBusUserInfo, DBusGroupInfo
Simon McVittie [Tue, 30 Jun 2020 18:29:06 +0000 (19:29 +0100)] 
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>
5 years agouserdb: Make lookups return a const pointer
Simon McVittie [Tue, 30 Jun 2020 18:13:17 +0000 (19:13 +0100)] 
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>
5 years agoMerge branch 'illumos_cmsg' into 'master'
Simon McVittie [Mon, 15 Jun 2020 13:16:51 +0000 (13:16 +0000)] 
Merge branch 'illumos_cmsg' into 'master'

Solaris and derivatives do not adjust cmsg_len on MSG_CTRUNC

Closes #304

See merge request dbus/dbus!165

5 years agoSolaris and derivatives do not adjust cmsg_len on MSG_CTRUNC
Andy Fiddaman [Fri, 12 Jun 2020 12:32:20 +0000 (12:32 +0000)] 
Solaris and derivatives do not adjust cmsg_len on MSG_CTRUNC

5 years agoMerge branch 'cmake-fix-install' into 'master'
Simon McVittie [Wed, 10 Jun 2020 18:22:48 +0000 (18:22 +0000)] 
Merge branch 'cmake-fix-install' into 'master'

cmake: Fix installed files

See merge request dbus/dbus!155

5 years agocmake: add support for user session semantic on Linux operating systems
Ralf Habacker [Mon, 18 May 2020 10:47:51 +0000 (12:47 +0200)] 
cmake: add support for user session semantic on Linux operating systems

Systemd user support is controlled by the cmake variable ENABLE_USER_SESSION,
which and WITH_SYSTEMD_USERUNITDIR to specify a custom installation
location. If WITH_SYSTEMD_USERUNITDIR is not specified, the related install
path is determined from an installed systemd package, if present.

This was added to the Autotools build system as part of fd.o#61301,
but until now was not possible to enable when building with CMake.

5 years agocmake: Add support for systemd integration on Linux operating systems
Ralf Habacker [Mon, 18 May 2020 10:44:37 +0000 (12:44 +0200)] 
cmake: Add support for systemd integration on Linux operating systems

Previously, only the Autotools build system could do this. This commit
includes most of the same features as in the Autotools build, although
not the user-session semantics, which will be added separately.

Systemd support is controlled by the cmake variable ENABLE_SYSTEMD, which can
have the values OFF, ON and AUTO, the latter enabling support by default if
the required libraries are available.

With WITH_SYSTEMD_SYSTEMUNITDIR a custom installation location can be specified.
If it is not specified, the related install path is determined from the installed
systemd package, if present.

5 years agocmake: Add macro check_auto_option() as an addition to add_auto_option()
Ralf Habacker [Mon, 18 May 2020 10:51:03 +0000 (12:51 +0200)] 
cmake: Add macro check_auto_option() as an addition to add_auto_option()

check_auto_option() checks the values given to an auto-option and prints
a fatal error in case of invalid combinations.

5 years agocmake: rename tristateoption() to add_auto_option() and make signature compatible...
Ralf Habacker [Mon, 18 May 2020 10:02:36 +0000 (12:02 +0200)] 
cmake: rename tristateoption() to add_auto_option() and make signature compatible to option()

5 years agocmake: Use CMAKE_INSTALL_FULL_<dir> for configuration and state
Ralf Habacker [Thu, 23 Apr 2020 16:41:03 +0000 (18:41 +0200)] 
cmake: Use CMAKE_INSTALL_FULL_<dir> for configuration and state

This means we apply GNUInstallDirs' various special cases when
the prefix is /, /usr or something starting with /opt; these are
not applied when installing to CMAKE_INSTALL_<dir>. See
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#special-cases

5 years agocmake: fix installation of example files
Ralf Habacker [Thu, 23 Apr 2020 16:37:54 +0000 (18:37 +0200)] 
cmake: fix installation of example files

5 years agoMerge branch 'normalize-trailing-newlines' into 'master'
Simon McVittie [Wed, 10 Jun 2020 10:56:26 +0000 (10:56 +0000)] 
Merge branch 'normalize-trailing-newlines' into 'master'

Normalize C source files to end with exactly one newline

See merge request dbus/dbus!162

5 years agoNormalize C source files to end with exactly one newline
Simon McVittie [Wed, 10 Jun 2020 08:47:15 +0000 (09:47 +0100)] 
Normalize C source files to end with exactly one newline

Some editors automatically remove trailing blank lines, or
automatically add a trailing newline to avoid having a trailing
non-blank line that is not terminated by a newline. To avoid unrelated
whitespace changes when users of such editors contribute to dbus,
let's pre-emptively normalize all files.

Unlike more intrusive whitespace normalization like removing trailing
whitespace from each line, this seems unlikely to cause significant
issues with cherry-picking changes to stable branches.

Implemented by:

    find . -name '*.[ch]' -print0 | \
    xargs -0 perl -0777 -p -i -e 's/\n+\z//g; s/\z/\n/g'

Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years agoMerge branch 'misc-comment' into 'master'
Simon McVittie [Wed, 10 Jun 2020 10:46:42 +0000 (10:46 +0000)] 
Merge branch 'misc-comment' into 'master'

dbus-protocol.h: fix DBUS_ERROR_SPAWN_NO_MEMORY comment

See merge request dbus/dbus!163