| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Fixes:
https://gitlab.freedesktop.org/dbus/dbus/-/issues/405
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we're running in a sandbox, we might not have write access to
oom_score_adj. In the common case where we don't have any special
protection from the OOM-killer, we can detect that with only read
access, and skip the part where we open it for writing.
(We would also not have write access to oom_score_adj if we're running
with elevated Linux capabilities while not root, but that should never
actually happen for dbus-daemon-launch-helper, which is setuid root
for production use or has no capabilities during unit-testing.)
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
Split _dbus_server_listen_platform_specific() to handle unix listenable
address independently, allowing Windows support in following commit.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
Split _dbus_transport_open_unix_socket() to leave the "unixexec:"
handling to the unix-specific unit.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
Split out the Unix socket handling from open_platform_specific(),
enabling "unix:" connectable addresses on Windows in next patch.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
Share the same constant for all systems.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
The function declaration can be moved to system-agnostic header and be
implemented on Windows in following commits.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
This will allow to abstract away for Windows Unix socket support.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
Now that _dbus_close_socket() invalidates the socket on its own already.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
This can simplify error handling in many situation where a socket is
returned, such as in the following commits.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
This will allow to invalidate the socket in the following commit.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
PF_UNIX is an old BSD 4.x relic, and even there they promise that PF_UNIX
is the same as AF_UNIX. (Linux socket(2))
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
As pointed out by Simon McVittie <smcv@collabora.com>:
https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/249#note_1323102
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The X11 connection is opened and never closed. Because dbus-launch
forks and continues to run non-trivial code in a forked child, it is
not clear whether (or where) it would be safe to close it; instead, we
leave it open until process exit, at which point the socket is cleaned
up by the kernel.
Any memory allocated for the X11 connection is only allocated once per
run of dbus-launch, so there's no need to keep track of it, and we can
silence these memory leak warnings as uninteresting.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
| |
At the time we do this check, version_script has not yet been generated,
so we have to use something else.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
|
|
|
| |
Recent versions of valgrind have library code, which we don't need (or
want) to link to; all we actually want is <valgrind.h> and <memcheck.h>.
I had hoped that this would suppress the Requires.private when
generating our .pc file, but it doesn't seem to.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
| |
As long as we are treating Autotools as a first-class citizen, what we
release will be `make distcheck` output.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
| |
Signed-off-by: Félix Piédallu <felix@piedallu.me>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
| |
When verbose mode is enabled, this information is useful for debugging.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In _dbus_get_autolaunch_address() instead of polling at intervals to see
if the shared memory segment is present, the named signal is now used to
reliably get the state of dbus-daemon.
In _dbus_get_autolaunch_shm() the unnecessary initialization of `address`
has been removed, error handling has been improved and the `wait` parameter
has been added to select waiting.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
|
|
|
|
|
|
| |
This will allow automated tests to kill the autostarted dbus-daemon
before continuing to the next test-case, which wasn't previously
possible.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
|
|
|
|
|
| |
For that purpose the function _dbus_test_win_set_autolaunch_command_line_parameter()
has been added.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
| |
|
|
|
|
|
|
| |
I am trying to use DBus on an Arm Morello system where sizeof(void *) is
16 and not 8, so the assertion in the line below can fail unless we ensure
that element_size is at least sizeof(void *).
|
|
|
|
|
|
|
|
|
|
| |
DBUS_CONSOLE_AUTH_DIR is deprecated since 1.11.18, and was intended to
have been removed in 1.13. Let's drop the related code now.
Fixes: https://gitlab.freedesktop.org/dbus/dbus/-/issues/181
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101629
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
| |
../../dbus/dbus-message.c:5462:17: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
5462 | unsigned char len;
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
|
| |
When DBUS_ENABLE_VERBOSE_MODE is not set, the compiler warns.
Let's remove the label.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
support thread locking
The previously used additional and incomplete functions have been merged
into the current rmutex functions to fix the reported bug and reduce the
maintenance effort.
Fixes #368, #370
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
|
|
|
| |
These values will be appropriately aligned, so we can silence the warning
by adding a void* cast.
|
|
|
|
|
| |
We have ensured that the values are aligned at runtime, but Clang's
warning cannot see that. Silence the warning with a void* cast.
|
|
|
|
|
| |
This triggers when building on FreeBSD with clang, but since we know that
the CMSG_DATA() will be aligned we can silence the warning using a cast.
|
|
|
|
|
|
|
|
|
| |
This fixes a -Wcast-align warning from Clang, and I believe this could
be a genuine issue on some architectures since the octets argument is
an unsigned char pointer that only has alignment 1. Using memcpy() instead
will generate the same code on architectures that support unaligned loads
and stores (i.e. almost all current ones) and individual stores on those
that don't (e.g. old MIPS).
|
|
|
|
|
|
|
| |
Clang performs the -Wcast-align analysis before code generation and
optimizations, so the compiler cannot see that the alignment is actually
guaranteed to be sufficient for these casts. Silence the warning by adding
casts to void* and/or changing the types of some variables.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tests are enabled with the embedded tests; the required
low-level functions from the dbus library are decorated with
DBUS_EMBEDDED_TESTS_EXPORT to indicate the appropriate usage.
On Windows, all tests are run; on unix-like operating systems,
individual tests are disabled:
- the tests on #NULL pointers of type DBus[C|R]Mutex, since they
point to a data structure and would cause a segment violation
when accessed.
- the multiple lock test for type DBusCMutex, since it would block
the current thread.
Since the whole point of "rmutex" is to be able to lock multiple
times, the "rmutex double lock" test is enabled on unix-like
operating systems too.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
|
|
|
|
|
|
|
|
| |
This detects some error conditions that can only occur as a
result of a programming error, such as attempting to unlock a
mutex that is not locked.
Fixes #369
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
|
|
|
|
|
|
| |
This function provides a portable way to print data as hex values.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
[smcv: Only compile this when needed, improve assertions, coding style]
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
| |
Unlike the rest of the macros in dbus-macros.h, this one would never
have made sense to use in a public header.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
|
|
| |
This avoids a circular dependency: I want to use
DBUS_ENABLE_EMBEDDED_TESTS in dbus-string.h, but
DBUS_ENABLE_EMBEDDED_TESTS was previously defined in dbus-internals.h,
which depends on dbus-string.h.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
|
|
|
| |
To fix this problem, the problematic code was replaced by a new function
_dbus_string_get_allocated_size(), which uses the existing macro
DBUS_CONST_STRING_PREAMBLE for these purposes.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Part-of: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/275
Reviewed-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
|
|
| |
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>
|