Commit graph

436 commits

Author SHA1 Message Date
Marc-André Lureau
95df73b463 cmake/autotools: remove HAVE_DIRFD/HAVE_DDFD
dirfd() is assumed to be present on Linux, dd_fd is never used.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Alex Richardson
56e52a4212 configure: Avoid exit() when checking for __sync_sub_and_fetch()
Use of exit() requires a stdlib.h include. This check was failing for me
since the compiler defaulted to -Werror=implicit-function-declaration, so
__sync_sub_and_fetch() support was not dectected.
2022-05-26 11:26:38 +00:00
Marc-André Lureau
b342ed53e5 build-sys: console-auth-dir leftovers
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-20 13:40:58 +00:00
Marc-André Lureau
cf124a41d7 autotools: drop --with-console-auth-dir=
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-19 22:19:25 +02:00
Simon McVittie
ccea70515e sysdeps: On Linux, wrap close_range syscall directly if necessary
This was added to the Linux kernel in version 5.9, but the wrapper
wasn't added to glibc until 2.34. Adding our own wrapper for the
system call means we can use close_range() on Debian 11 and
contemporary distributions.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-21 11:02:44 +01:00
Simon McVittie
d307616177 sysdeps: Include <linux/close_range.h> if available
This lets us use CLOSE_RANGE_CLOEXEC whenever the kernel headers
support it, even if glibc doesn't include this header via unistd.h yet.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-21 11:02:44 +01:00
Simon McVittie
ee694ade61 sysdeps: Use close_range() if available
The version with no flags set, which is a slight generalization of
closefrom(), is available on recent Linux and FreeBSD.

The version with CLOSE_RANGE_CLOEXEC is Linux-specific.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-21 11:02:14 +01:00
rim
54c62040b2 Use closefrom() to not loop over all possible file descriptors
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/278
2022-04-21 11:02:14 +01:00
Simon McVittie
6130ac4267 build: Define DBUS_INT64_MODIFIER, analogous to G_GINT64_MODIFIER
Using PRId64, etc. to print dbus_int64_t or dbus_uint64_t is not 100%
portable. On platforms where both long and long long are 64-bit (such as
Linux and macOS), we will prefer to define dbus_int64_t as long.
If the operating system has chosen to define int64_t as long long,
which is apparently the case on macOS, then the compiler can warn that
we are passing a long argument to PRId64, which is "lld" and therefore
expects a long long argument (even though that ends up with the same
bit-pattern being used).

We can't necessarily just use int64_t and uint64_t directly, even if all
our supported platforms have them available now, because swapping
dbus_int64_t between long and long long might change C++ name mangling,
causing ABI breaks in third-party libraries if they define C++ functions
that take a dbus_int64_t argument.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-19 18:27:47 +00:00
Lars Wendler
c71f013a64
Convert "if" calls to AS_IF macro for the block that handles X11 2022-03-01 19:02:22 +01:00
Lars Wendler
bf3cb42c6d
Add have_x11=no if --without-x was given to make later checks happy 2022-03-01 19:02:15 +01:00
Lars Wendler
17c88a8944
Emit an error when --with-x was given but no X11 libs were found 2022-03-01 19:01:17 +01:00
Lars Wendler
51e468d828
Move DBUS_X_* definitions into PKG_CHECK_MODULES block 2022-03-01 19:01:07 +01:00
Lars Wendler
99cc28e0eb
build: Treat --with-x[=yes] the same as --with-x=auto
Previously, --with-x would disable the check for X11 libraries, which
was not intended.
2022-03-01 18:59:00 +01:00
Simon McVittie
d0cdd94a3e Post-release version bump for 1.15.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 18:20:08 +00:00
Simon McVittie
6fd1509ba3 Prepare v1.14.0
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/350
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:43:32 +00:00
Simon McVittie
daf362ee61 build: Opt out from using mingw-w64's replacement printf(), etc.
The Windows code in dbus is careful to use Windows-specific equivalents
of the Standard C features that are not implemented by msvcrt.dll, so
we don't need to substitute a Standard C printf implementation.

This avoids compiler warnings/errors when gcc expects us to be using
Microsoft printf syntax (`ms_printf` attribute), but newer versions of
mingw-w64 expect us to be using GNU or Standard C printf syntax
(`gnu_printf` attribute) as a result of `__USE_MINGW_ANSI_STDIO` being
enabled by default if not otherwise specified.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/380
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 17:05:56 +00:00
Simon McVittie
21784cacd3 Start development of dbus 1.13.24
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 19:40:15 +00:00
Simon McVittie
0381298e45 Prepare dbus 1.13.22 and spec 0.38
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 14:35:10 +00:00
Simon McVittie
31b5e0ff8b Bump version number for continued development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-12-17 15:50:15 +00:00
Simon McVittie
f013f991fa Prepare v1.13.20
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-12-17 13:07:48 +00:00
Simon McVittie
9d60676ae0 Disable the Containers interface
We've had a request for a 1.14.x stable-branch, but the Containers
interface is only partially implemented, not yet described in the
D-Bus Specification, and not ready to be part of our API guarantees.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-12-10 16:48:51 +00:00
SCOTT-HAMILTON
6bfaea0707 autotools: use pkg-config instead of AC_PATH_XTRA 2021-11-26 15:38:10 +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
41dfee5c32 Start 1.13.18 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-06-02 21:07:31 +01:00
Simon McVittie
fc2ee9f73b Prepare 1.13.16
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-06-02 12:18:05 +01:00
Ralf Habacker
6e8d75834e Add support to generate the api documentation in Qt help format
Qt help files are used by Qt Creator and KDevelop, for example, to support
the development of Qt-based applications and libraries.

Generating api documentation in Qt help format is controlled by two
user specific options named --enable-qt-help and --with-qchdir (autotools)
and -DENABLE_QT_HELP and -DINSTALL_QCH_DIR (cmake).
2020-04-29 15:23:23 +00:00
Simon McVittie
da0db314a3 Start dbus 1.13.16 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-21 21:02:03 +01:00
Simon McVittie
f741c14d17 Reference implementation v1.13.14 and Specification v0.36
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-21 11:25:27 +01:00
Natanael Copa
6d92e8e983 _dbus_generate_random_bytes: use getrandom(2)
Use getrandom(2) and fall back to /dev/urandom if it is missing or if it
fails some any reason.

This solves problem where dbus-uuidgen is called from a chroot which
lacks /dev/urandom.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 16:56:59 +01:00
Simon McVittie
3197cbe369 Merge branch 'non-posix-getwpnam-r' into 'master'
Remove support for non-POSIX getpwnam_r()

See merge request dbus/dbus!11
2020-03-11 14:15:29 +00:00
Simon McVittie
942bb14708 Start 1.13.14 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 16:28:25 +01:00
Simon McVittie
df9dabe521 Prepare version 1.13.12
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-09 13:09:15 +01:00
Simon McVittie
f79aa63045 Start dbus 1.13.12 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-05-17 15:47:29 +01:00
Simon McVittie
99f0821bfb Prepare release v1.13.10 and Specification v0.35
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-05-13 14:24:06 +01:00
Topi Miettinen
94b5b236aa
Configure option to disable traditional activation
Traditional activation could be disabled if all services use
SystemdService activation instead. Provide an example of a hardened
DBus systemd service drop-in file for such a setup.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2019-03-25 21:51:33 +02:00
Ralf Habacker
760e30ec03 Do not let doxygen build man pages on Windows
This fixes an issue on gitlab CI not been able to create man page
output dir. Also man pages does not make sense on Windows.
2019-03-13 10:13:09 +01:00
Ralf Habacker
d9fa5aee84 Generate documentation html index file from doc/index.html.in for autotools and cmake
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:57:57 +01:00
Simon McVittie
402344e89e Merge branch 'ax-missing' into 'master'
configure.ac: Forbid AX_-prefixed patterns more selectively

Closes #249

See merge request dbus/dbus!86

Reviewed-by: @pwithnall
2019-01-21 16:22:14 +00:00
Simon McVittie
e23bba929a test: Move dbus-daemon-launch-helper-test here, and rename
The -test suffix does not indicate that this is a test, but rather that
it is for tests (similar to the -unix and -win suffixes on modules like
dbus-sysdeps). This seems unnecessarily confusing, so rename it to end
with -for-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:18:46 +00:00
Simon McVittie
ee09cc0acd configure.ac: Forbid AX_-prefixed patterns more selectively
We want to make autoconf fail early and with a user-comprehensible
message if autoconf-archive isn't installed, rather than generating
a configure script with syntax errors, or a configure script that runs
successfully but doesn't do what we intended.

However, autoconf-archive doesn't actually guarantee not to use
AX_-prefixed shell variable names without m4_pattern_allow'ing them
(unlike Autoconf, Automake, Libtool and pkg-config, which explicitly use
m4_pattern_allow for variables with AC_, AM_, LT_ and PKG_ prefixes), so
it isn't safe to assume that they won't be used. In particular, recent
versions of AX_CHECK_GNU_MAKE appear to be using
$AX_CHECK_GNU_MAKE_HEADLINE as a shell variable.

Instead, specifically forbid the names of the finite list of macros
that we actually use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus#249
2019-01-21 14:28:24 +00:00
Ralf Habacker
602f4506a8 Add glib 2.38 support 2019-01-06 21:24:10 +01:00
Simon McVittie
9490e954d0 test-privserver: Move helper executable out of name-test/
This means we don't need to distinguish between DBUS_NAME_TEST_EXEC and
DBUS_TEST_EXEC any more, because all test helper executables are in the
same place, both during build and when installed (we don't install
test-privserver since no installed test requires it yet, but in
principle we could).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-13 13:08:00 +00:00
Simon McVittie
0c9f943277 build: Add a way to set CFLAGS for AddressSanitizer etc.
We don't want to set these globally via the normal CFLAGS, because if
we did, AddressSanitizer would catch test-segfault deliberately
segfaulting, and "helpfully" turn it into exit status 1, which in turn
makes our test fail because it asserts that the segfault is reported
as a segfault.

A typical use with gcc as compiler, on a reasonably recent Debian,
would be:

    ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie"

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Ralf Habacker
d9de6ab213 Add build system variable DBUS_NAME_TEST_EXEC to cover differences in executable paths
Autotools creates executable applications in the respective
subdirectory of the build directory, while cmake creates
them in <build-root>/bin.

This leads to different paths in the file created
from org.freedesktop.DBus.TestSuite.PrivServer.service.in,
which are fixed by the new variable.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-12-11 10:41:07 +00:00
Simon McVittie
a59eb6e944 Merge branch 'unpythonize' into 'master'
Translate Python-based tests to C

See merge request dbus/dbus!37

Reviewed-by: pwithnall
2018-12-05 14:09:00 +00:00
Simon McVittie
c1e39d414f Start working on dbus 1.13.10
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 17:25:20 +00:00
Simon McVittie
ca1eafbb7f 1.13.8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 12:27:32 +00:00
Simon McVittie
1191262f5e Translate Python-based tests to C
This simplifies bootstrapping: now you don't have to build dbus,
build dbus-python (with GLib), and use dbus-python to test dbus.

It also avoids test failures when using facilities like
AddressSanitizer. When libdbus is built with AddressSanitizer, but the
system copies of Python and dbus-python were not, dbus-python will exit
the Python interpreter on load, because libasan wasn't already
initialized. The simplest way to avoid this is to not use Python:
the scripts are not *that* hard to translate into C.

Both of these tests happen to be conditionally compiled for Unix only.
test_activation_forking() relies on code in TestSuiteForkingEchoService
that calls fork(), which can only work on Unix; meanwhile,
test_system_signals() tests the system bus configuration, which is
only relevant to Unix because we don't support using dbus-daemon as
a privilege boundary on Windows (and in any case D-Bus is not a Windows
OS feature, so the system bus cannot be used to communicate with OS
services like it can on most Linux systems).

This is also a partial solution to
<https://gitlab.freedesktop.org/dbus/dbus/issues/135>, by reducing the
size of name-test/.

For this to work, we need to build the test-service helper executable
even if embedded tests are disabled.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-03 17:42:48 +00:00
Simon McVittie
06f467d689 Merge branch 'simplify-configure-checks' into 'master'
Simplify configure checks

See merge request dbus/dbus!10
2018-11-21 16:14:11 +00:00