summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-kernel.c
AgeCommit message (Collapse)Author
2014-11-28treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1Lennart Poettering
2014-11-28sd-bus: add arrays of strings in the bloom filterLennart Poettering
Let's do this right from the beginning, to prepare ground for udev messages that most likely want to store list of strings (for device tags) in messages, and filter on them.
2014-11-28sd-bus: add new call sd_bus_get_scope() for querying whether one is ↵Lennart Poettering
connected to a system or a user bus
2014-11-28sd-bus: rework credential query logicLennart Poettering
Also, make the call to free kdbus slices generic and use it everywhere
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-28kdbus: when running in a container, don't complain that we cannot write to /sysLennart Poettering
2014-11-28sd-bus: the attach_mask kernel module parameter is 64bit now, hence ↵Lennart Poettering
initialize it as such
2014-11-27kdbus: set kernel attach mask before creating the first busLennart Poettering
2014-11-27sd-bus: when we get the list of well-known names back from kdbus we ↵Lennart Poettering
shouldn't confuse the empty list with unknown information
2014-11-27sd-bus: unify logic how we patch the message source of driver messagesLennart Poettering
2014-11-27sd-bus: fake valid well-known-names metadata for faked bus messagesLennart Poettering
2014-11-27sd-bus: optimize how we generate the well-known-names lists in messages from ↵Lennart Poettering
kdbus
2014-11-27sd-bus: be stricter with mismatches between dbus1 and kdbus message headersLennart Poettering
2014-11-27bus: prefix custom endpoints with "$UID-"David Herrmann
The kdbus module will later get a policy that endpoint-names are restricted to "<uid>-<name>" just like bus-names. Make sure that systemd is already compatible to that.
2014-11-26sd-bus: given that the kernel now passes the auxgroups list as 32bit array ↵Lennart Poettering
to us, no need to convert to uid_t manually This way, we can save one allocation and avoid copying the array unnecesarily.
2014-11-26bus: update kdbus.h (ABI break)David Herrmann
We changed creds to u32, so fix systemd sd-bus to acknowledge that.
2014-11-26bus-kernel: when installing an activator, ask for any kind of metadata to be ↵Lennart Poettering
attached to incoming messages We don't know what the activated service might want in the end, hence enable everything current and future, just to be sure.
2014-11-26sd-bus: don't clobber return values on failure in bus_kernel_open_bus_fd()Lennart Poettering
2014-11-26sd-bus: set per-bus attach flag requirement mask to ANYLennart Poettering
On the system and user busses we create it's the receiver that chooses which metadata is attched, not the sender, hence set the requirement mask to ANY, to allow any current of future credential bit to be attached.
2014-11-26sd-bus: add suppot for renegotiating message credential attach flagsLennart Poettering
2014-11-25sd-bus: react properly to EOVERFLOW by generating a log message about ↵Lennart Poettering
dropped broadcast messages and proceeding
2014-11-25kdbus: minor simplificationLennart Poettering
2014-11-25sd-bus: fix error handling when receiving invalid service nameLennart Poettering
Also, properly keep track of incoming additional service names.
2014-11-25sd-bus: properly handle non-initialized audit records attached to incoming ↵Lennart Poettering
kernel messages
2014-11-25sd-bus: add supplementary groups list to creds objectLennart Poettering
2014-11-25sd-bus: update to current kernel version, by splitting off the extended ↵Lennart Poettering
KDBUS_ITEM_PIDS structure from KDBUS_ITEM_CREDS Also: - adds support for euid, suid, fsuid, egid, sgid, fsgid fields. - makes augmentation of creds with data from /proc explicitly controllable to give apps better control over this, given that this is racy. - enables augmentation for kdbus connections (previously we only did it for dbus1). This is useful since with recent kdbus versions it is possible for clients to control the metadata they want to send. - changes sd_bus_query_sender_privilege() to take the euid of the client into consideration, if known - when we don't have permissions to read augmentation data from /proc, don't fail, just don't add the data in
2014-11-13sd-bus: sync with kdbus upstream (ABI break)Daniel Mack
kdbus has seen a larger update than expected lately, most notably with kdbusfs, a file system to expose the kdbus control files: * Each time a file system of this type is mounted, a new kdbus domain is created. * The layout inside each mount point is the same as before, except that domains are not hierarchically nested anymore. * Domains are therefore also unnamed now. * Unmounting a kdbusfs will automatically also detroy the associated domain. * Hence, the action of creating a kdbus domain is now as privileged as mounting a filesystem. * This way, we can get around creating dev nodes for everything, which is last but not least something that is not limited by 20-bit minor numbers. The kdbus specific bits in nspawn have all been dropped now, as nspawn can rely on the container OS to set up its own kdbus domain, simply by mounting a new instance. A new set of mounts has been added to mount things *after* the kernel modules have been loaded. For now, only kdbus is in this set, which is invoked with mount_setup_late().
2014-11-11sd-bus: add sd_bus_message.verify_destination_id and .destination_ptrDaniel Mack
kdbus learned to accept both a numerical destination ID as well as a well-known-name. In that case, kdbus makes sure that the numerical ID is in fact the owner of the provided name and fails otherwise. This allows for race-free assertion of a bus name owner while sending a message, which is a requirement for bus-proxyd. Add two new fields to sd_bus_message, and set the numerical ID to verify_destination_id if bus_message_setup_kmsg() is called for a message with a well-known name. Also, set the destination's name in the kdbus item to .destination_ptr if it is non-NULL. Normal users should not touch these fields, and they're not publicy accessible.
2014-11-05sd-bus: by default allow all creds to be passed alongLennart Poettering
2014-11-05sd-bus: sync up with new kdbus metadata attachment logic (ABI break)Daniel Mack
The metadata logic in kdbus has seen a rework, and the only mandatory change we have to follow for now is that attach_flags in kdbus_cmd_hello is now split into two parts, attach_flags_send and attach_flags_recv.
2014-11-04sd-bus: rename "connection name" to "description" for the sd-bus API tooLennart Poettering
kdbus recently renamed this concept, and so should we in what we expose in userspace.
2014-11-04sd-bus: sync kdbus.h (ABI break)Daniel Mack
Catch up with some changes in kdbus.h: * KDBUS_{ITEM,ATTACH}_CONN_NAME were renamed to KDBUS_{ITEM,ATTACH}_CONN_DESCRIPTION, so the term 'name' is not overloaded as much. * The item types were re-ordered a little so they are lined up to the order of the corresponding KDBUS_ATTACH flags * A new item type KDBUS_ITEM_OWNED_NAME was introduced, designated to store a struct kdbus_name in item->name. KDBUS_ITEM_NAME soley stores data in item->str now * Some kerneldoc fixes
2014-10-31sd-bus: add missing includeTom Gundersen
2014-10-30memfd: always use our internal utility functions where we have themLennart Poettering
2014-10-30memfd: always create our memfds with CLOEXEC setLennart Poettering
We really shouldn't create fds ever that have the flag unset.
2014-10-27sd-bus: sync kdbus.h (ABI break)Daniel Mack
Some comment fixes and header cleanups in kdbus.h, and the task capability meta information has been factored out to its own struct.
2014-10-22sd-bus: assert clock_gettime()'s return valueDaniel Mack
Don't handle clock_gettime() errors gracefully but use assert_se().
2014-10-21sd-bus: sync kdbus.h (API change: switch to absolute timeouts)Daniel Mack
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>
2014-10-21sd-bus: sync kdbus.h (ABI break)Daniel Mack
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.
2014-10-20sd-bus: sync kdbus.h (ABI break)Daniel Mack
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.
2014-10-18sd-bus: sync kdbus.h (ABI break)Daniel Mack
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.
2014-10-17Revert "sd-bus: sync kdbus.h (ABI break)"Kay Sievers
This reverts commit 1a2409e262da65a4b0ca8ab18fcf5eabd2d404ca. Support from the kdbus interface was removed. We require memfds to be supported by all clients.
2014-10-14sd-bus: sync kdbus.h (ABI break)Daniel Mack
kdbus learned KDBUS_HELLO_ACCEPT_MEMFD as new connection negotiation flag. Set it by default in systemd for now.
2014-10-08sd-bus: sync kdbus.h (ABI break)Daniel Mack
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)
2014-10-07sd-bus: fix use-after-free in close_kdbus_msg()Daniel Mack
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.
2014-10-07sd-bus: remove unused variableThomas Hindoe Paaboel Andersen
It is no longer used after d663f1b1a92a778bcdc68f29b8c08cb49431b4f7
2014-10-06sd-bus: sync kdbus.h (ABI break)Daniel Mack
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.
2014-10-03sd-bus: split out cleanup into separate functionZbigniew Jędrzejewski-Szmek
m is always non-null at this point. This function is too long anyway.
2014-10-02kdbus: don't clobber return values, use strjoin() instead of asprintf(), ↵Lennart Poettering
keep function invocations and variable declarations separate