]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
2 years agodoc: Repeat a copyright notice in a form understood by SPDX tools
Simon McVittie [Mon, 14 Aug 2023 15:54:13 +0000 (16:54 +0100)] 
doc: Repeat a copyright notice in a form understood by SPDX tools

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoNEWS: Update
Simon McVittie [Mon, 14 Aug 2023 15:29:33 +0000 (16:29 +0100)] 
NEWS: Update

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoINSTALL: Rewrite extremely outdated list of dependencies
Simon McVittie [Mon, 14 Aug 2023 15:29:24 +0000 (16:29 +0100)] 
INSTALL: Rewrite extremely outdated list of dependencies

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agorelease-checklist: Update for increased use of Meson
Simon McVittie [Mon, 14 Aug 2023 15:18:58 +0000 (16:18 +0100)] 
release-checklist: Update for increased use of Meson

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoINSTALL: Remove generic Autotools installation instructions
Simon McVittie [Mon, 14 Aug 2023 15:18:39 +0000 (16:18 +0100)] 
INSTALL: Remove generic Autotools installation instructions

Now that we are recommending Meson, let's de-emphasize Autotools.
Anyone who still needs Autotools will already know how it works, at
least generically.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoREADME, INSTALL: Move build/install instructions into INSTALL
Simon McVittie [Mon, 14 Aug 2023 15:17:46 +0000 (16:17 +0100)] 
README, INSTALL: Move build/install instructions into INSTALL

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'time64' into 'master'
Simon McVittie [Mon, 14 Aug 2023 14:45:53 +0000 (14:45 +0000)] 
Merge branch 'time64' into 'master'

On 32-bit glibc, define _TIME_BITS to 64 if not already defined

Closes #465

See merge request dbus/dbus!416

2 years agoOn 32-bit glibc, define _TIME_BITS to 64 if not already defined
Simon McVittie [Mon, 7 Aug 2023 19:19:17 +0000 (20:19 +0100)] 
On 32-bit glibc, define _TIME_BITS to 64 if not already defined

On older 32-bit architectures such as i386, this redefines time_t to be
64-bit, and correspondingly increases the size of all system data
structures that contain a time_t, such as struct timeval and struct stat.
This is necessary to allow timestamps beyond January 2038 to be
represented; as well as things that obviously deal with timestamps,
this affects functions like stat() (and therefore our wrapper
_dbus_stat()), which will fail with EOVERFLOW if asked to inspect a
file whose correct timestamp does not fit in time_t.

In particular, if the modification or access timestamp on
/etc/machine-id has somehow been set to a post-2038 time, libdbus will
consider the inability to stat() that file to be an installation error,
and when using the deprecated dbus_get_local_machine_id(), that can
cause third-party i386 software such as the Steam client to crash.
Using 64-bit timestamps avoids that failure mode.

Using 64-bit timestamps in glibc is an opt-in and not the default,
because if done carelessly it can change libraries' ABIs. However,
libdbus is careful not to include system headers and system data
types in its own headers, with the only exceptions being extremely
basic ISO C headers like <stddef.h> and <stdarg.h>; so we can safely
do this without it breaking our ABI. This is similar to the reasoning
for why commit 96ffc2a0 "configure.ac: support large-file for stat64"
was a safe change.

This change only affects glibc. Some non-GNU operating system libraries
(such as musl) are less concerned with binary backwards compatibility
than glibc, and therefore have incompatibly changed their ABI on 32-bit
platforms to switch to 64-bit timestamps throughout; no action is needed
on those platforms. If other non-GNU OS libraries have taken a route
similar to GNU's, then maintainers of those operating systems are
welcome to send tested merge requests similar to this one.

An extra subtlety here is that _TIME_BITS=64 requires
_FILE_OFFSET_BITS=64. In the Meson build, Meson unconditionally enables
_FILE_OFFSET_BITS=64 where appropriate, and in the Autotools build,
we already had that via AC_SYS_LARGEFILE, but in the CMake build we
did not necessarily have this; so we also define _FILE_OFFSET_BITS=64
there if necessary, as a continuation of commit 96ffc2a0
"configure.ac: support large-file for stat64".

On newer 32-bit architectures like x32, time_t is always 64-bit and so
this has no practical effect.

On 64-bit, setting these would have no practical effect, but to minimize
risk I'm only doing this for 32-bit architectures.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/465
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'pidfd' into 'master'
Simon McVittie [Tue, 8 Aug 2023 11:45:34 +0000 (11:45 +0000)] 
Merge branch 'pidfd' into 'master'

Use PID FD if available from SO_PEERPIDFD, and return it via GetConnectionCredentials()

See merge request dbus/dbus!398

2 years agobus: return ProcessFD in GetConnectionCredentials()
Luca Boccassi [Mon, 20 Mar 2023 01:55:18 +0000 (01:55 +0000)] 
bus: return ProcessFD in GetConnectionCredentials()

Allows to track a process by pinning to a file descriptor,
which unlike a PID cannot be reused.

root@image:~# busctl call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus GetConnectionCredentials "s" org.freedesktop.systemd1
a{sv} 3 "ProcessID" u 1 "UnixUserID" u 0 "ProcessFD" h 4

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years ago_dbus_asv_add_unix_fd: add
Luca Boccassi [Mon, 20 Mar 2023 02:35:10 +0000 (02:35 +0000)] 
_dbus_asv_add_unix_fd: add

Add a new helper to add unix FDs to arrays. Will be used for
GetConnectionCredentials().

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoDBusCredentials: add support for PID FDs via SO_PEERPIDFD
Luca Boccassi [Mon, 20 Mar 2023 02:00:51 +0000 (02:00 +0000)] 
DBusCredentials: add support for PID FDs via SO_PEERPIDFD

The new socket option SO_PEERPIDFD allows to pin the process on the
other side of the socket by file descriptor, which closes a race
condition where a PID can be reused before we can pin it manually.
Available since Linux v6.5.

When storing credentials, pin the process by FD from the PID.
When querying the PID, if the PID FD is available, resolve
it from there first if possible.

Ensure the DBusCredentials object only returns the PID FD if it was
obtained by this call, so that we know for sure we can rely on it
being safe against PID reuse attacks.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoMerge branch 'ci-fixes' into 'master'
Simon McVittie [Tue, 8 Aug 2023 11:10:03 +0000 (11:10 +0000)] 
Merge branch 'ci-fixes' into 'master'

CI: cleanup setting build directory

See merge request dbus/dbus!424

2 years agotools/ci-build.sh: cleanup setup and usage of ci_builddir
Ralf Habacker [Mon, 7 Aug 2023 09:36:21 +0000 (11:36 +0200)] 
tools/ci-build.sh: cleanup setup and usage of ci_builddir

The order and arrangement of the initialization of the build directories
has been improved: the deletion of special directories have been moved to
the associated part, the rest have been merged and there is a default
value if not specified as an environment variable, making it easier to
execute on the command line.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2 years agoCI: add prefix 'ci_' to env var 'builddir'
Ralf Habacker [Fri, 4 Aug 2023 09:56:12 +0000 (11:56 +0200)] 
CI: add prefix 'ci_' to env var 'builddir'

This customization simplifies their use, e.g. when outputting the command
line used. Because of FreeBSD, 'awk' is used instead of 'gawk' to make
sure that the tool is available.

2 years agoMerge branch 'cmake-using-meson-variables' into 'master'
Simon McVittie [Mon, 7 Aug 2023 14:59:34 +0000 (14:59 +0000)] 
Merge branch 'cmake-using-meson-variables' into 'master'

Let cmake retrieve version and variable information from meson build system

See merge request dbus/dbus!382

2 years agoLet cmake retrieve version and variable information from meson build system
Ralf Habacker [Mon, 2 Jan 2023 16:10:19 +0000 (17:10 +0100)] 
Let cmake retrieve version and variable information from meson build system

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2 years agocmake: reorder include header and function checks to match meson build system
Ralf Habacker [Mon, 7 Aug 2023 13:46:52 +0000 (15:46 +0200)] 
cmake: reorder include header and function checks to match meson build system

2 years agoMerge branch 'systemd_user' into 'master'
Simon McVittie [Fri, 4 Aug 2023 14:52:07 +0000 (14:52 +0000)] 
Merge branch 'systemd_user' into 'master'

systemd: start as the D-Bus user/group, rather than root

See merge request dbus/dbus!399

2 years agosystemd: start as the D-Bus user/group, rather than root
Luca Boccassi [Mon, 20 Mar 2023 01:48:06 +0000 (01:48 +0000)] 
systemd: start as the D-Bus user/group, rather than root

When starting as root files in /proc/self/fdinfo/ will be owned as root
and set to 400, so we cannot read them. Nowadays it is not necessary to
start as root when running under systemd, so just add User/Group with
the configured user to the system unit.

If libaudit support is enabled, add AmbientCapabilities=CAP_AUDIT_WRITE
so that we can still write to the audit log.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoRevert "CI: Only run "opensuse mingw64 meson debug" if triggered manually"
Ralf Habacker [Thu, 3 Aug 2023 08:44:16 +0000 (10:44 +0200)] 
Revert "CI: Only run "opensuse mingw64 meson debug" if triggered manually"

This reverts commit 0f902faa3893ca80b33106c2d43909eeb793616b.

See https://gitlab.freedesktop.org/dbus/dbus/-/issues/469

2 years agoMerge branch 'pid_fd_spec' into 'master'
Simon McVittie [Wed, 2 Aug 2023 15:14:46 +0000 (15:14 +0000)] 
Merge branch 'pid_fd_spec' into 'master'

spec: add ProcessFD to GetConnectionCredentials()

See merge request dbus/dbus!420

2 years agospec: add ProcessFD to GetConnectionCredentials()
Luca Boccassi [Mon, 20 Mar 2023 01:50:53 +0000 (01:50 +0000)] 
spec: add ProcessFD to GetConnectionCredentials()

Make D-Bus implementations return a file descriptor
pinning the process as part of the credentials on
platforms that implement such concept, like Linux.

Pinning the process allows to defend against PID
reuse attacks, making authentication by
service/cgroup possible.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoMerge branch 'master' into 'master'
Simon McVittie [Tue, 1 Aug 2023 18:39:16 +0000 (18:39 +0000)] 
Merge branch 'master' into 'master'

dbus-daemon: Avoid known options being interpreted as optional arguments

Closes #467

See merge request dbus/dbus!421

2 years agodbus-daemon: Avoid known options being interpreted as optional arguments
Xin Shi [Fri, 28 Jul 2023 01:38:24 +0000 (09:38 +0800)] 
dbus-daemon: Avoid known options being interpreted as optional arguments

The man page and --help imply that

    dbus-daemon --print-address --print-pid

is a valid/useful thing to do, but because --print-address takes an
optional argument, it is ambiguous whether --print-pid is meant to
be the argument for --print-address (same as --print-address=--print-pid)
or a new option (same as --print-address=1 --print-pid). In fact,
before this commit, the dbus-daemon would interpret --print-pid as
the optional argument to --print-address, and then fail to parse it
because it isn't an integer.

Because none of our options are syntactically valid as arguments for
any option that takes an optional argument, we can avoid the ambiguity
by delaying parsing of optional arguments until all known options
have been tried.

Resolves: dbus/dbus#467

Signed-off-by: Xin Shi <shixin21@huawei.com>
2 years agoMerge branch 'empty-group-list' into 'master'
Simon McVittie [Tue, 1 Aug 2023 18:23:09 +0000 (18:23 +0000)] 
Merge branch 'empty-group-list' into 'master'

dbus-sysdeps-unix: Handle empty supplementary group list

See merge request dbus/dbus!422

2 years agodbus-sysdeps-unix: Check socklen_t is unsigned when getting group list
cptpcrd [Mon, 31 Jul 2023 23:33:33 +0000 (19:33 -0400)] 
dbus-sysdeps-unix: Check socklen_t is unsigned when getting group list

After the change to handle an empty list properly, the function now
assumes that is true.

2 years agodbus-sysdeps-unix: Handle empty supplementary group list
cptpcrd [Sun, 30 Jul 2023 22:38:22 +0000 (18:38 -0400)] 
dbus-sysdeps-unix: Handle empty supplementary group list

It is valid for getsockopt(SO_PEERGROUPS) to return len=0; that
indicates the process has no supplementary groups. Rather than failing,
simply use the returned empty list (and add the primary GID to it).

Without this change, calling GetConnectionCredentials on a bus name
owned by a process with no supplementary groups does not return the
UnixGroupIDs field, even though it is easy to determine that the process
only has one GID (the primary GID).

2 years agoMerge branch 'adduser' into 'master'
Simon McVittie [Tue, 1 Aug 2023 18:02:33 +0000 (18:02 +0000)] 
Merge branch 'adduser' into 'master'

Fix CI failures

Closes #468

See merge request dbus/dbus!423

2 years agoCI: Only run "opensuse mingw64 meson debug" if triggered manually
Simon McVittie [Tue, 1 Aug 2023 17:48:30 +0000 (18:48 +0100)] 
CI: Only run "opensuse mingw64 meson debug" if triggered manually

Mitigates: dbus/dbus#469
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Make user creation idempotent
Simon McVittie [Tue, 1 Aug 2023 17:30:14 +0000 (18:30 +0100)] 
CI: Make user creation idempotent

adduser --system exits successfully if the user already exists, but
ordinary adduser doesn't.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/468
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'override_dep_name' into 'master'
Simon McVittie [Tue, 13 Jun 2023 18:53:14 +0000 (18:53 +0000)] 
Merge branch 'override_dep_name' into 'master'

meson: Override "dbus-1" dependency name

See merge request dbus/dbus!415

2 years agomeson: Override "dbus-1" dependency name
Barnabás Pőcze [Tue, 13 Jun 2023 16:12:26 +0000 (18:12 +0200)] 
meson: Override "dbus-1" dependency name

Since meson 0.54.0, it is possible to override a dependency name,
so do that to make it easy to use dbus as a subproject. After this
change, simply

  dependency('dbus-1')

will fall back to the subproject automatically and there is no need
for using `fallback` keyword argument. Of course this assumes that
the dbus source tree is at subprojects/dbus-1 and not subprojects/dbus
but it is easy to achieve that.

If the dbus source tree for some reason needs to be at subprojects/dbus,

  dependency('dbus-1', fallback: 'dbus')

may be used, which still has the advantage of not needing to
depend on the variable names in the dbus build definitions.

2 years agoMerge branch 'wip/work-around-462' into 'master'
Simon McVittie [Tue, 13 Jun 2023 13:16:30 +0000 (13:16 +0000)] 
Merge branch 'wip/work-around-462' into 'master'

CI: Don't run windows-meson-mingw-ucrt64 by default

See merge request dbus/dbus!414

2 years agoCI: Enable "debian mingw64 meson debug" by default
Simon McVittie [Tue, 13 Jun 2023 12:59:21 +0000 (13:59 +0100)] 
CI: Enable "debian mingw64 meson debug" by default

This gives us coverage for Meson mingw-w64 by default, but
cross-compiling from Debian with MSVCRT rather than a native compilation
on Windows with UCRT. When combined with "windows msys64 ucrt64 cmake",
this fills in most of the missing coverage caused by disabling
windows-meson-mingw-ucrt64 to work around dbus#462.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Don't run windows-meson-mingw-ucrt64 by default
Simon McVittie [Tue, 13 Jun 2023 12:57:25 +0000 (13:57 +0100)] 
CI: Don't run windows-meson-mingw-ucrt64 by default

Workaround for dbus#462: if this doesn't run reliably as a result of
external factors, then we shouldn't be using it as a CI gate.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'issue-455' into 'master'
Simon McVittie [Tue, 13 Jun 2023 11:58:07 +0000 (11:58 +0000)] 
Merge branch 'issue-455' into 'master'

CI: Fix problem with configuration when cross building with cmake

Closes #455

See merge request dbus/dbus!413

2 years agoCI: restore cross building with cmake
Ralf Habacker [Mon, 12 Jun 2023 19:35:32 +0000 (21:35 +0200)] 
CI: restore cross building with cmake

2 years agoCI: Fix problem with configuration when cross building with cmake
Ralf Habacker [Mon, 12 Jun 2023 17:55:05 +0000 (19:55 +0200)] 
CI: Fix problem with configuration when cross building with cmake

Due to an adaptation of an rpm macro for cross-compiling with cmake, there
was a problem with the previous method of using the current directory as
the build directory. Instead, the command line options provided by cmake
are now used to define the source and build directories, which provide more
stable behavior.

Fix #455

2 years agoMerge branch 'wip/meson-warnings' into 'master'
Simon McVittie [Wed, 7 Jun 2023 12:26:30 +0000 (12:26 +0000)] 
Merge branch 'wip/meson-warnings' into 'master'

meson: Disable some warnings when asserts/checks are disabled

See merge request dbus/dbus!412

2 years agomeson: Disable some warnings when asserts/checks are disabled 412/head
Simon McVittie [Tue, 6 Jun 2023 12:07:04 +0000 (13:07 +0100)] 
meson: Disable some warnings when asserts/checks are disabled

Some labels are only used when checks are enabled, and some variables
are only used when assertions and/or checks are enabled. Instead of
cluttering the code with extra #ifdefs, we silence those warnings:
they're harmless in this case. We already do this in Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'wip/issue453' into 'master'
Simon McVittie [Wed, 7 Jun 2023 12:08:04 +0000 (12:08 +0000)] 
Merge branch 'wip/issue453' into 'master'

cmake: Define _GNU_SOURCE before checking for any symbols

Closes #453

See merge request dbus/dbus!411

2 years agosysdeps: Correct fallback signature of Linux close_range() 411/head
Simon McVittie [Tue, 6 Jun 2023 12:05:41 +0000 (13:05 +0100)] 
sysdeps: Correct fallback signature of Linux close_range()

Linux generally declares syscalls with flags as type int. It's the same
ABI, but a slightly different API, and it seems better for our fallback
definition to match it exactly.

Related to dbus/dbus#453.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agocmake: Define _GNU_SOURCE before checking for any symbols
Simon McVittie [Tue, 6 Jun 2023 12:33:00 +0000 (13:33 +0100)] 
cmake: Define _GNU_SOURCE before checking for any symbols

Some of the symbols we check for, such as close_range(), are only
declared in their corresponding header files if _GNU_SOURCE was
defined.

Resolves: dbus/dbus#453
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoRelease v1.15.6 dbus-1.15.6
Simon McVittie [Tue, 6 Jun 2023 12:59:52 +0000 (13:59 +0100)] 
Release v1.15.6

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoAUTHORS: Update
Simon McVittie [Tue, 6 Jun 2023 12:47:38 +0000 (13:47 +0100)] 
AUTHORS: Update

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoUpdate NEWS
Simon McVittie [Tue, 6 Jun 2023 09:48:03 +0000 (10:48 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agomonitor test: Reproduce dbus/dbus#457
Simon McVittie [Mon, 5 Jun 2023 17:51:22 +0000 (18:51 +0100)] 
monitor test: Reproduce dbus/dbus#457

The exact failure mode reported in dbus/dbus#457 is quite difficult
to achieve in a reliable way in a unit test, because we'd have to send
enough messages to a client to fill up its queue, then stop that client
from draining its queue, while still triggering a message that gets a
reply from the bus driver. However, we can trigger the same crash in a
slightly different way by not allowing the client to receive a
particular message. I chose NameAcquired.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agobus: Assign a serial number for messages from the driver
hongjinghao [Mon, 5 Jun 2023 17:17:06 +0000 (18:17 +0100)] 
bus: Assign a serial number for messages from the driver

Normally, it's enough to rely on a message being given a serial number
by the DBusConnection just before it is actually sent. However, in the
rare case where the policy blocks the driver from sending a message
(due to a deny rule or the outgoing message quota being full), we need
to get a valid serial number sooner, so that we can copy it into the
DBUS_HEADER_FIELD_REPLY_SERIAL field (which is mandatory) in the error
message sent to monitors. Otherwise, the dbus-daemon will crash with
an assertion failure if at least one Monitoring client is attached,
because zero is not a valid serial number to copy.

This fixes a denial-of-service vulnerability: if a privileged user is
monitoring the well-known system bus using a Monitoring client like
dbus-monitor or `busctl monitor`, then an unprivileged user can cause
denial-of-service by triggering this crash. A mitigation for this
vulnerability is to avoid attaching Monitoring clients to the system
bus when they are not needed. If there are no Monitoring clients, then
the vulnerable code is not reached.

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus/dbus#457

2 years agomonitor test: Log the messages that we monitored
Simon McVittie [Mon, 5 Jun 2023 16:56:33 +0000 (17:56 +0100)] 
monitor test: Log the messages that we monitored

This is helpful while debugging test failures.

Helps: dbus/dbus#457
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoRevert "CI: Remove an obsolete workaround"
Simon McVittie [Tue, 6 Jun 2023 10:00:28 +0000 (11:00 +0100)] 
Revert "CI: Remove an obsolete workaround"

It appears some freedesktop CI runners still have /builds/dbus/dbus
owned by a different user ID.
This reverts commit 3f6400b8b929d902b7317e90440bd369c8f5407a.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoREADME: Mention not opening merge requests for security issues
Simon McVittie [Tue, 6 Jun 2023 09:41:35 +0000 (10:41 +0100)] 
README: Mention not opening merge requests for security issues

The dbus maintainers can open confidential merge requests by using a
private git repository, but other contributors (including most security
researchers) cannot, so the safest simple recommendation is no merge
requests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoREADME: Adjust wording
Simon McVittie [Tue, 6 Jun 2023 09:39:40 +0000 (10:39 +0100)] 
README: Adjust wording

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoUpdate NEWS
Simon McVittie [Mon, 5 Jun 2023 18:49:31 +0000 (19:49 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'readme-meson-steps' into 'master'
Simon McVittie [Fri, 2 Jun 2023 15:09:12 +0000 (15:09 +0000)] 
Merge branch 'readme-meson-steps' into 'master'

README: add meson build steps

See merge request dbus/dbus!402

2 years agoREADME: add meson build steps
Ahmed Abdelfattah [Sun, 16 Apr 2023 11:21:35 +0000 (13:21 +0200)] 
README: add meson build steps

* Add meson build instructions and reorder the README sections
* Fix a small typo for the security section

Signed-off-by: Ahmed Abdelfattah <a.abfattah@gmail.com>
2 years agoMerge branch 'wip/smcv/reinstate-windows-ci' into 'master'
Simon McVittie [Tue, 16 May 2023 11:01:27 +0000 (11:01 +0000)] 
Merge branch 'wip/smcv/reinstate-windows-ci' into 'master'

Revert "CI: Disable native Windows builds for now"

Closes #456

See merge request dbus/dbus!406

2 years agoRevert "CI: Disable native Windows builds for now"
Simon McVittie [Tue, 16 May 2023 10:46:22 +0000 (11:46 +0100)] 
Revert "CI: Disable native Windows builds for now"

It seems they do work, it was just very slow to build the image.

This reverts commit a3a14ea09eb3ade08cd6b4c6af57afd8b1c0b8bb.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/456
Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'read_procfs' into 'master'
Simon McVittie [Mon, 15 May 2023 20:16:02 +0000 (20:16 +0000)] 
Merge branch 'read_procfs' into 'master'

Support /proc in _dbus_file_get_content

See merge request dbus/dbus!401

2 years agoSupport /proc in _dbus_file_get_content
Luca Boccassi [Mon, 20 Mar 2023 01:40:20 +0000 (01:40 +0000)] 
Support /proc in _dbus_file_get_content

procfs has special semantics: most files are 0 size,
only one read can be done on a file, and they are
not larger than 4MB. Enhance _dbus_file_get_content()
so that we can read files from /proc with it.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoMerge branch 'use_func_macro' into 'master'
Simon McVittie [Mon, 15 May 2023 19:01:40 +0000 (19:01 +0000)] 
Merge branch 'use_func_macro' into 'master'

do not use __FUNCTION__ directly

See merge request dbus/dbus!404

2 years agodbus-spawn-win: use `_DBUS_FUNCTION_NAME` instead of `__FUNCTION__`
Barnabás Pőcze [Thu, 4 May 2023 14:37:57 +0000 (16:37 +0200)] 
dbus-spawn-win: use `_DBUS_FUNCTION_NAME` instead of `__FUNCTION__`

dbus-internals.h already defines a macro which expands to the name
of the current function based on C standard version, etc. So use
that instead of hard-coding `__FUNCTION__`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2 years agodbus-sysdeps-win: do not log function name twice
Barnabás Pőcze [Thu, 4 May 2023 14:31:44 +0000 (16:31 +0200)] 
dbus-sysdeps-win: do not log function name twice

`_dbus_verbose()` already logs the function name,
do not log it again in the message.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2 years agodbus-internals: use `_DBUS_FUNCTION_NAME` in `_dbus_verbose()`
Barnabás Pőcze [Thu, 4 May 2023 14:26:31 +0000 (16:26 +0200)] 
dbus-internals: use `_DBUS_FUNCTION_NAME` in `_dbus_verbose()`

dbus-internals.h already defines a macro which expands to the name
of the current function based on C standard version, etc. So use
that instead of hard-coding `__FUNCTION__`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2 years agoMerge branch 'dbus_msg_iter_fix_memleak' into 'master'
Simon McVittie [Mon, 15 May 2023 18:55:43 +0000 (18:55 +0000)] 
Merge branch 'dbus_msg_iter_fix_memleak' into 'master'

dbus_message_iter_get_signature: Fix two memory leaks

See merge request dbus/dbus!403

2 years agodbus_message_iter_get_signature: Fix two memory leaks on OOM
Barnabás Pőcze [Sat, 22 Apr 2023 19:37:59 +0000 (21:37 +0200)] 
dbus_message_iter_get_signature: Fix two memory leaks on OOM

Previously,  `retstr` would not be freed when `_dbus_string_append_len()`
or `_dbus_string_steal_data()` failed.

Fix those by:
 * jumping to `_dbus_string_free()` when `_dbus_string_append_len()` fails
 * ignoring the return value of `_dbus_string_free()`.

The latter works because in case of failure, `ret` will be set
to NULL by `_dbus_string_steal_data()`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2 years agoMerge branch 'wip/smcv/fix-ci' into 'master'
Simon McVittie [Fri, 12 May 2023 18:06:36 +0000 (18:06 +0000)] 
Merge branch 'wip/smcv/fix-ci' into 'master'

Fix CI

See merge request dbus/dbus!405

2 years agoCI: Disable native Windows builds for now
Simon McVittie [Fri, 12 May 2023 17:35:13 +0000 (18:35 +0100)] 
CI: Disable native Windows builds for now

These are extremely slow (the image build is currently at 36 minutes
and still running) which is standing in the way of us having functional
CI at all. They can be re-enabled if someone will maintain them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Disable "opensuse mingw64 cmake debug" until #455 is fixed
Simon McVittie [Fri, 12 May 2023 17:32:35 +0000 (18:32 +0100)] 
CI: Disable "opensuse mingw64 cmake debug" until #455 is fixed

Having some CI is better than having no CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Avoid using a no-op download location that gives a 403 error
Simon McVittie [Fri, 12 May 2023 16:48:48 +0000 (17:48 +0100)] 
CI: Avoid using a no-op download location that gives a 403 error

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Make creation of user idempotent
Simon McVittie [Fri, 12 May 2023 15:19:38 +0000 (16:19 +0100)] 
CI: Make creation of user idempotent

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Disable OOM-testing code paths for Meson, matching Autotools and CMake
Simon McVittie [Fri, 12 May 2023 14:31:58 +0000 (15:31 +0100)] 
CI: Disable OOM-testing code paths for Meson, matching Autotools and CMake

Repeatedly re-running each test with different malloc() calls failing
is really slow, and in particular this is making
dbus:dbus / marshal-recursive time out on freedesktop.org CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Install mingw64-cross-cmake in openSUSE image
Simon McVittie [Fri, 12 May 2023 14:28:47 +0000 (15:28 +0100)] 
CI: Install mingw64-cross-cmake in openSUSE image

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Sort lists of openSUSE packages alphabetically
Simon McVittie [Fri, 12 May 2023 14:28:11 +0000 (15:28 +0100)] 
CI: Sort lists of openSUSE packages alphabetically

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Update Windows runners
Simon McVittie [Fri, 12 May 2023 14:24:17 +0000 (15:24 +0100)] 
CI: Update Windows runners

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Remove an obsolete workaround
Simon McVittie [Fri, 12 May 2023 14:01:32 +0000 (15:01 +0100)] 
CI: Remove an obsolete workaround

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Update to current fdo CI templates
Simon McVittie [Fri, 12 May 2023 14:01:15 +0000 (15:01 +0100)] 
CI: Update to current fdo CI templates

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Only run for pushes to dbus
Simon McVittie [Fri, 12 May 2023 14:23:27 +0000 (15:23 +0100)] 
CI: Only run for pushes to dbus

In practice the pipeline is going to fail for namespaces other than
dbus, so don't waste time on trying to run it there; only run the
detached pipeline for the MR.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoCI: Run a detached pipeline for merge requests
Simon McVittie [Fri, 12 May 2023 14:00:34 +0000 (15:00 +0100)] 
CI: Run a detached pipeline for merge requests

After abuses of fdo infrastructure were mitigated in
freedesktop/freedesktop#540, contributors cannot usually run pipelines
in their own forks of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'cmake_unistd' into 'master'
Simon McVittie [Tue, 21 Mar 2023 20:21:22 +0000 (20:21 +0000)] 
Merge branch 'cmake_unistd' into 'master'

cmake: add missing HAVE_SYS_SYSCALL_H define

See merge request dbus/dbus!400

2 years agocmake: add missing HAVE_SYS_SYSCALL_H define
Luca Boccassi [Mon, 20 Mar 2023 13:37:08 +0000 (13:37 +0000)] 
cmake: add missing HAVE_SYS_SYSCALL_H define

Signed-off-by: Luca Boccassi <bluca@debian.org>
2 years agoMerge branch 'fix-dbus-api-design-wrong-closing-tag' into 'master'
Simon McVittie [Thu, 2 Mar 2023 14:33:07 +0000 (14:33 +0000)] 
Merge branch 'fix-dbus-api-design-wrong-closing-tag' into 'master'

doc/dbus-api-design: fix wrong closing tag

See merge request dbus/dbus!396

2 years agodoc/dbus-api-design: fix wrong closing tag
Yen-Chin, Lee [Thu, 2 Mar 2023 07:31:28 +0000 (15:31 +0800)] 
doc/dbus-api-design: fix wrong closing tag

The original code of 'ProgressNotification' had a wrong closing tag,
which should use '</signal>' instead of '</method>'

Signed-off-by: Yen-Chin, Lee <coldnew.tw@gmail.com>
2 years agoMerge branch 'fix-issue-445' into 'master'
Simon McVittie [Tue, 21 Feb 2023 20:40:19 +0000 (20:40 +0000)] 
Merge branch 'fix-issue-445' into 'master'

CI: Make sure we always have a messagebus user, even if the dbus package isn't installed

Closes #445

See merge request dbus/dbus!394

2 years agotools/ci-install.sh: Make sure we always have a messagebus user, even if the dbus...
Ralf Habacker [Tue, 21 Feb 2023 09:37:36 +0000 (10:37 +0100)] 
tools/ci-install.sh: Make sure we always have a messagebus user, even if the dbus package isn't installed

This fixes a CI installation issue with the meson build system on openSUSE
distribution.

Fixes #445

2 years agoStart 1.15.6
Simon McVittie [Wed, 8 Feb 2023 16:53:37 +0000 (16:53 +0000)] 
Start 1.15.6

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoUpdate AUTHORS
Simon McVittie [Wed, 8 Feb 2023 16:51:33 +0000 (16:51 +0000)] 
Update AUTHORS

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoPrepare v1.15.4 dbus-1.15.4
Simon McVittie [Wed, 8 Feb 2023 11:55:54 +0000 (11:55 +0000)] 
Prepare v1.15.4

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoNEWS: Add #421
Simon McVittie [Wed, 8 Feb 2023 10:47:08 +0000 (10:47 +0000)] 
NEWS: Add #421

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years ago_dbus_string_skip_blank(): Let the final assert follow the previous search
Ralf Habacker [Thu, 19 Jan 2023 15:17:43 +0000 (16:17 +0100)] 
_dbus_string_skip_blank(): Let the final assert follow the previous search

This appears to have been a copy/paste mistake. If only blanks (defined as
spaces or tabs) were removed, then it cannot be right to check for white
space (defined as spaces, tabs, carriage return or linefeed) afterwards.

If libdbus was compiled with assertions enabled, then this is a
denial-of-service issue for dbus-daemon or other users of DBusServer:
an unauthenticated user with access to the server's socket can send
whitespace that triggers this assertion failure. We recommend that
production versions of dbus, for example in OS distributions, should be
compiled with checks but without assertions.

[smcv: expanded commit message]

Thanks: Evgeny Vereshchagin
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/421

2 years agoAdd test for _dbus_string_skip_blank()
Ralf Habacker [Thu, 19 Jan 2023 15:18:56 +0000 (16:18 +0100)] 
Add test for _dbus_string_skip_blank()

[smcv: Fix a memory leak]

Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/421

2 years agoUpdate NEWS for 1.15.x
Simon McVittie [Wed, 8 Feb 2023 10:32:54 +0000 (10:32 +0000)] 
Update NEWS for 1.15.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge branch 'add-ci-build-libdbus-subproject' into 'master'
Simon McVittie [Tue, 7 Feb 2023 10:05:16 +0000 (10:05 +0000)] 
Merge branch 'add-ci-build-libdbus-subproject' into 'master'

gitlab-ci: build libdbus as subproject

See merge request dbus/dbus!388

2 years agogitlab-ci: build libdbus as subproject
Daniel Wagner [Fri, 13 Jan 2023 12:29:06 +0000 (13:29 +0100)] 
gitlab-ci: build libdbus as subproject

Test it's possible to consume libdbus as a subproject.

Suggested-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Use list for dbus_static_flags
Daniel Wagner [Fri, 13 Jan 2023 13:04:19 +0000 (14:04 +0100)] 
build: Use list for dbus_static_flags

Meson complains that it is only allowed to concatenate list to lists and
not strings.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Origin: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/388

2 years agoMerge branch 'add-test-header-fields' into 'master'
Simon McVittie [Mon, 6 Feb 2023 13:58:57 +0000 (13:58 +0000)] 
Merge branch 'add-test-header-fields' into 'master'

cmake: add missing test for header-fields

See merge request dbus/dbus!322

2 years ago.gitlab-ci.yml: exclude non-functioning test 'header-fields' in job 'windows vs15...
Ralf Habacker [Fri, 7 Oct 2022 09:53:23 +0000 (11:53 +0200)] 
.gitlab-ci.yml: exclude non-functioning test 'header-fields' in job 'windows vs15-64 cmake'

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2 years agocmake: add missing test for header-fields
Ralf Habacker [Mon, 27 Jun 2022 21:18:09 +0000 (23:18 +0200)] 
cmake: add missing test for header-fields

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2 years agoMerge branch 'gitlab-ci' into 'master'
Simon McVittie [Mon, 6 Feb 2023 13:36:43 +0000 (13:36 +0000)] 
Merge branch 'gitlab-ci' into 'master'

CI: Avoid changing uid, except when running installed-tests

Closes #447

See merge request dbus/dbus!392

2 years agoCI: Re-run some tests as root or as non-root, as appropriate
Simon McVittie [Mon, 6 Feb 2023 13:24:11 +0000 (13:24 +0000)] 
CI: Re-run some tests as root or as non-root, as appropriate

On Gitlab-CI we're always running the overall script as root (and
therefore we'll only enter the code path to re-run as non-root),
but when using these scripts for manual testing they might be run as
non-root to begin with.

Signed-off-by: Simon McVittie <smcv@collabora.com>