Jan Tojnar [Thu, 11 Feb 2021 05:00:45 +0000 (06:00 +0100)]
doc: Introduce XML catalog
This adds a nice way of loading the DTD files based on the identifier
in the DOCTYPE declaration, no matter where the DTDs are installed.
See also ‘XML catalog’ Wikipedia entry and update-xmlcatalog(8).
Ralf Habacker [Tue, 15 Feb 2022 23:14:37 +0000 (00:14 +0100)]
dbus-daemon: Implement signal 'ActivatableServicesChanged'
After any reload of the activatable service files the mentioned signal is
emitted to the current bus to inform clients.
The calls to signal emmission have not been implemented in the platform
specific functions _dbus_daemon_report_reloaded() to avoid duplicate
implementations.
Kir Kolyshkin [Tue, 1 Feb 2022 04:31:11 +0000 (20:31 -0800)]
spec: add * to optionally-escaped bytes set
Commit ee71e1ff6033a added * to the list of optionally escaped bytes
set, but did not update the documentation. I guess this happened because
the change is not backward compatible.
It seems that the period of 14+ years should be enough to not cause any
backward compatibility issues, so let's document this.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Ralf Habacker [Tue, 14 Dec 2021 14:32:56 +0000 (15:32 +0100)]
_dbus_get_address_string() now expects an initialized DBusString instance as a parameter
The mentioned function now expects an initialized DBusString instance as
parameter for the return of a string to have a clear responsibility
regarding initialization and usage and thus simplify the "out of memory"
management.
Since the _dbus_get_shm_name() and _dbus_get_mutex_name() functions are
affected by the change, the related documentation has been adapted.
Simon McVittie [Wed, 15 Dec 2021 12:31:54 +0000 (12:31 +0000)]
test: Avoid misleading diagnostic when some tests are skipped
If we have 7 test-cases, of which we ran 3 and skipped 4, then it's
misleading to say "7 tests passed". Diagnose this as
"3 tests passed (4 skipped)" instead.
We can either skip tests by putting a specific test name on the test
command-line, or programmatically (for example the fd-passing test is
always skipped on Windows, because Windows cannot implement Unix
fd-passing).
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/363 Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 15 Dec 2021 11:41:05 +0000 (11:41 +0000)]
sysdeps: Make some functions Windows-specific
_dbus_daemon_publish_session_bus_address had an empty implementation
but was never actually called on Unix, and
_dbus_daemon_is_session_bus_address_published wasn't even implemented.
Move them to the Windows-specific header to indicate that interface
changes here would only affect other Windows-specific code.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 10 Dec 2021 15:12:59 +0000 (15:12 +0000)]
internals: Use Standard C offsetof macro if available
clang 13 fails to compile our current implementation with:
.../dbus/dbus-message.c:2070:3: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
_DBUS_STATIC_ASSERT (_DBUS_ALIGNOF (DBusMessageRealIter) <=
^
.../dbus/dbus-internals.h:460:25: note: expanded from macro '_DBUS_STATIC_ASSERT'
typedef struct { char _assertion[(expr) ? 1 : -1]; } \
This appears to be because the "traditional" definition of
offsetof(), which we're hard-coding here, does not qualify as a constant
expression under C rules due to its use of pointer casts.
Modern compilers like gcc and clang have a built-in implementation
of offsetof that *is* a constant expression.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 10 Dec 2021 14:31:45 +0000 (14:31 +0000)]
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>
Ralf Habacker [Mon, 6 Dec 2021 11:22:58 +0000 (12:22 +0100)]
cmake: add option ENABLE_VERBOSE_CONFIG
Checking the filenames of generated configuration files is now optionally
possible with this cmake option. They are no longer displayed by default
to avoid unnecessarily flooding the output.
Ralf Habacker [Thu, 9 Dec 2021 08:51:09 +0000 (09:51 +0100)]
Avoid assertation in bus_activation_reload()
In the mentioned function a local DBusError instance is now used to
fulfill the requirement of dbus_error_has_name() that the parameter
'error' must not be null.
Ralf Habacker [Wed, 8 Dec 2021 15:02:08 +0000 (16:02 +0100)]
Fix memory leaks in Windows variant of _dbus_directory_open()
If the memory is not sufficient, the created DBusString instance must be
released. This belongs to the mentioned function and
_dbus_string_init_from_string().
Simon McVittie [Fri, 3 Dec 2021 15:52:16 +0000 (15:52 +0000)]
_dbus_win_set_error_from_last_error: Always set the error
If we run out of memory while setting an error, we need to recover by
setting the error to "out of memory" instead of the original error.
Otherwise, the error indicator would be unset, breaking the rules of
our error model.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Thu, 11 Nov 2021 09:01:29 +0000 (10:01 +0100)]
tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows
dbus-run-session starts a dbus-daemon before the client application.
We must avoid letting the application try to connect before the
dbus-daemon's DBusServer is listening for connections.
In the Unix implementation, we already achieved this via the
--print-address option. If the client tried to connect too soon,
the server would not yet be listening and the client would fail.
In the Windows implementation, we communicate the bus address to
the client application as an autolaunch: address, so if the client
tried to connect too soon, it would autolaunch a new dbus-daemon
instead of using the one that it was intended to use.
We can avoid this by using a new option to pass in a Windows event
object, which will be set when the server has started and is ready
to process connections.