Age | Commit message (Collapse) | Author |
|
__attribute__((used)) is not enough to force static variables to
be carried over to a compiled program from a library. Mappings defined
in libsystemd-shared.a were not visible in the compiled binaries.
To ensure that the mappings are present in the final binary, the
tables are made non-static and are given a real unique name by which
they can be referenced.
To use a mapping defined not in the local compilation unit (e.g. in
a library) a reference to the mapping table is added. This is done
by including a declaration in the header file.
Expected values in test-engine are fixed to reflect the new mappings.
|
|
Depending on the link order, holes might appear in the body of
the sd_bus_errnomap section. Ignore them.
Adds a simple test to print the table to help with debugging such
issues in the future.
|
|
|
|
This allows custom "name" ↔ errno mappings to be registered.
Tables from all compilation units are concatenated.
|
|
provided headers
|
|
|
|
We really shouldn't create fds ever that have the flag unset.
|
|
files, for dissection with wireshark
|
|
|
|
Add bridge port attributes to sd-rtnl to configure
via networkd.
|
|
This patch adds functionality to set family type
in the rtnl message for example PF_BRIDGE.
|
|
The kernel mostly does not check this, but let's be consisntent and allways set it anyway. Based
on patch from Susant Sahani.
|
|
We must filter out the 'network-byteorder' and 'nested' flags.
|
|
right occasions
|
|
spec
|
|
Some comment fixes and header cleanups in kdbus.h, and the task capability
meta information has been factored out to its own struct.
|
|
Let's give coverity a hint what's going on here.
|
|
This reverts commit b1543c4c93855b61b40118e9f14a0423dac2e078.
We check b->address anyway, no need to check the return value,
especially given that the other #ifdef branch don't get the same
treatment.
|
|
sd_bus_error, just go on
sd_bus_error_setfv() must initialize the sd_bus_error value to some
sensible value and then return a good errno code matching that. If it
cannot work at all it should set the error statically to the OOM error.
But if it can work half-way (i.e. initialize the name, but not the
message) it should do so and still return the correct errno number for
it.
This effectively reverts 8bf13eb1e02b9977ae1cd331ae5dc7305a305a09
|
|
The way process_closing() picks the first entry from reply_callbacks
and works with it makes it likely that it cares about the order.
|
|
Systemd 209 started setting $WATCHDOG_PID, and sd-daemon watch was
modified to check for this variable. This means that
sd_watchdog_enabled() stopped working with previous versions of
systemd. But sd-event is a public library and API and we must keep it
working even when a program compiled with a newer version of the
libary is used on a system running an older version of the manager.
getenv() and unsetenv() are fairly expensive calls, so optimize
sd_watchdog_enabled() by not calling them when unnecessary.
man: centralize the description of $WATCHDOG_PID and $WATCHDOG_USEC in
the sd_watchdog_enabled manpage. It is better not to repeat the same
stuff in two places.
|
|
string_is_safe()
After all, we know have this as generic validator, so let's be correct
and use it wherver applicable.
|
|
sd_bus_get_owner_creds() was only halfly ported over to
_cleanup_bus_creds_unref_.
|
|
kdbus learned a new ioctl to tell userspace about a bus creator's
credentials, which is what we need to implement sd_bus_get_owner_creds() for
kdbus.
Move the function from sd-bus.c to bus-control.c to be able to reuse
the bus_populate_creds_from_items() helper.
|
|
sd_bus_get_peer_creds()
Clean up the function namespace by renaming the following:
sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid()
sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id()
sd_bus_get_peer_creds() → sd_bus_get_owner_creds()
|
|
We will re-use the code to walk items in order to populate a creds object,
so let's factor it out first.
|
|
kdbus learned a new command to query a bus creator's credentials. Sync
kdbus.h first, which also renames some struct to more generic terms.
That is, however, not an ABI break this time.
|
|
Don't handle clock_gettime() errors gracefully but use assert_se().
|
|
kdbus_msg.timeout_ns now takes an absolute value, based on CLOCK_MONOTONIC,
in order to eventually support automatically restarted syscalls.
Signed-off-by: Daniel Mack <daniel@zonque.org>
|
|
In kdbus.h, the following details changed:
* All commands gained a 'kernel_flags' field to report the flags supported
by the driver. Before, this was done in the 'flags' field in a
bidirectional way, which turned out to be a problem for the code in
sd-bus, as many parts of it reuse the same ioctl struct more than once
and consider them to be owned by userspace.
* Name listings are now returned by a new struct instead of reusing struct
kdbus_cmd_name for that matter. This way, we don't add more unneeded
fields to it and make the API cleaner.
* 'conn_flags' was renamed to 'flags' in struct kdbus_cmd_hello to make
the API a bit more unified.
|
|
|
|
kdbus.h now has KDBUS_ATTACH_COMM split into KDBUS_ATTACH_TID_COMM and
KDBUS_ATTACH_PID_COMM. The items were split already, so the change in
systemd is easy.
|
|
In kdbus.h, the 'features' field has been dropped again. Instead of
negotiating features that way, we decided to make the kernel return the
set of supported flags in each ioctl struct's .flags field, in both the
success and error cases.
|
|
This reverts commit 1a2409e262da65a4b0ca8ab18fcf5eabd2d404ca.
Support from the kdbus interface was removed. We require
memfds to be supported by all clients.
|
|
kdbus learned KDBUS_HELLO_ACCEPT_MEMFD as new connection negotiation
flag. Set it by default in systemd for now.
|
|
|
|
|
|
FAIL: test-engine
=================
Cannot find cgroup mount point: No such file or directory
Assertion 'r >= 0' failed at ../src/test/test-engine.c:46, function main(). Aborting.
FAIL: test-sched-prio
=====================
Cannot find cgroup mount point: No such file or directory
Assertion 'r >= 0' failed at ../src/test/test-sched-prio.c:42, function main(). Aborting.
FAIL: test-bus-cleanup
======================
Assertion 'sd_bus_open_system(&bus) >= 0' failed at ../src/libsystemd/sd-bus/test-bus-cleanup.c:40, function test_bus_open(). Aborting.
after new: refcount 1
|
|
Commit 710fc9779b7c (kdbus repo) introduced attaching items[]
instead of name[] in kdbus_cmd_conn_info struct. Commit 581fe6c81
(systemd repo) caught up with this change, but item size was not
properly calculated.
|
|
Check for OOM conditions of asprintf() in bus_set_address_user().
|
|
|
|
When a child event is disabled (in order to be freed) and there is no
SIGCHLD signal event, sd_event_source_set_enabled will disable SIGCHLD
even if there are other child events.
Also remove some unneeded signalfd updates.
https://bugs.freedesktop.org/show_bug.cgi?id=84659
Based-on-a-patch-by: Hristo Venev <mustrumr97@gmail.com>
|
|
Sync kdbus.h once again. Two thing have changed:
a) KDBUS_CMD_EP_* was renamed to KDBUS_CMD_ENDPOINT_*
b) struct kdbus_cmd_hello and struct kdbus_cmd_make gained a
'features' bitfield (which is currently unused)
|
|
Check for OOM situations when vasprintf() returns < 0 in bus_error_setfv().
Spotted by coverity.
|
|
Fix a user of the KDBUS_CMD_FREE ioctl that was missed in the transition.
|
|
Walk the items first, then free the memory of the message.
Also, while at it, make coverity happy with an explicit (void) prefix.
We intentionally ignore the return value here.
|
|
It is no longer used after d663f1b1a92a778bcdc68f29b8c08cb49431b4f7
|
|
The KDBUS_CMD_FREE ioctl now uses a struct rather than a direct pointer
to the offset to free.
The KDBUS_CMD_MSG_CANCEL ioctl has also changes, but there's no user of
it yet in systemd.
|
|
CID #996315.
|
|
If we are bothering to check whether the kernel is not feeding us
bad data, we might as well do it properly.
CID #1237692.
|