1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
Commit Graph

475 Commits

Author SHA1 Message Date
Lennart Poettering
cf226cfc24 sd-bus: make sure that when we connect to the system bus we have enough creds to make security decisions 2014-11-26 18:59:31 +01:00
Lennart Poettering
d108ddf172 sd-bus: update kdbus.h from upstream 2014-11-26 15:43:50 +01:00
Lennart Poettering
e12d81ae80 sd-bus: given that the kernel now passes the auxgroups list as 32bit array 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-26 14:59:12 +01:00
David Herrmann
affc7fe9e1 bus: update kdbus.h (ABI break)
We changed creds to u32, so fix systemd sd-bus to acknowledge that.
2014-11-26 11:11:54 +01:00
Lennart Poettering
38813cc824 bus-kernel: when installing an activator, ask for any kind of metadata to be 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-26 03:06:50 +01:00
Lennart Poettering
8aee3fc7ea sd-bus: don't clobber return values on failure in bus_kernel_open_bus_fd() 2014-11-26 03:06:50 +01:00
Lennart Poettering
fa7796e97b sd-bus: set per-bus attach flag requirement mask to ANY
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-26 03:06:50 +01:00
Lennart Poettering
b5dae4c7f7 sd-bus: add suppot for renegotiating message credential attach flags 2014-11-26 02:20:55 +01:00
Lennart Poettering
f3c0588651 sd-bus: use free_and_strdup() where appropriate
This simplifies things a bit and makes sure we free any previously set
creds component before writing in a new one.
2014-11-26 02:20:55 +01:00
Lennart Poettering
bd5f920f12 core: show log message about process triggering kdbus service activation 2014-11-25 20:52:48 +01:00
Lennart Poettering
f9a458c666 sd-bus: react properly to EOVERFLOW by generating a log message about dropped broadcast messages and proceeding 2014-11-25 20:42:31 +01:00
Lennart Poettering
48eaba354e kdbus: update header file to current upstream version 2014-11-25 19:25:33 +01:00
Lennart Poettering
0a9f1fd79b kdbus: minor simplification 2014-11-25 19:25:19 +01:00
Lennart Poettering
9f6dfd0624 sd-bus: fix error handling when receiving invalid service name
Also, properly keep track of incoming additional service names.
2014-11-25 14:28:34 +01:00
Lennart Poettering
6dfcc64bb5 sd-bus: properly handle non-initialized audit records attached to incoming kernel messages 2014-11-25 14:28:34 +01:00
Lennart Poettering
a6ede528c4 sd-bus: properly copy selinux label and description field when duplicating creds object 2014-11-25 14:28:34 +01:00
Lennart Poettering
0258159049 sd-bus: add supplementary groups list to creds object 2014-11-25 14:28:34 +01:00
Lennart Poettering
2e9efd22ce busctl: if no parameter is specified for "busctl status" show credentials of bus owner 2014-11-25 14:28:34 +01:00
Lennart Poettering
becca6eaaf sd-bus: properly handle uninitialized audit creds from kdbus 2014-11-25 14:28:34 +01:00
Lennart Poettering
359c09b1c1 sd-bus: don't fail when querying creds and dbus1 refuses to tell us the selinux context 2014-11-25 14:28:34 +01:00
Lennart Poettering
40ed1a4574 busctl: add new --augment-creds= switch for controlling whether shown credential data shall be augment with data from /proc 2014-11-25 14:28:34 +01:00
Lennart Poettering
705a415f68 sd-bus: update to current kernel version, by splitting off the extended 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-25 14:28:34 +01:00
Lennart Poettering
1d58a1fe13 busctl: improve readability a bit 2014-11-25 14:28:34 +01:00
Lennart Poettering
5cf4f2d176 bus: change creds dumping order to be more close to internal storage order 2014-11-25 14:28:34 +01:00
Lennart Poettering
dc18cefdc3 sd-bus: don't blindly take incomplete ucred bits from AF_UNIX when constructing message 2014-11-25 14:28:34 +01:00
Lennart Poettering
a44b10818a busctl: add --timeout= option to specify method call timeout 2014-11-21 20:31:50 +01:00
Lennart Poettering
3805157836 busctl: add options to control message header flags when invoking methods 2014-11-21 20:13:26 +01:00
Lennart Poettering
1fc5560911 busctl: show property values in "introspect" output, add "set-property" command, and support both a terse and a verbose output format 2014-11-21 00:32:02 +01:00
Lennart Poettering
b18ec7e29f busctl: when --address is specified do not assume we connect to a full bus 2014-11-21 00:32:02 +01:00
Lennart Poettering
79f34de9fb busctl: use canned error message on parse failure 2014-11-21 00:32:02 +01:00
Lennart Poettering
0ca454d474 sd-bus: create clean error when a property Set() call with incorrect signature is passed in 2014-11-21 00:32:02 +01:00
Lennart Poettering
73fc23c064 busctl: pass error output to stdout (rather than stderr) when generate tree for all objects
This is a ton more useful when some services fail, since we continue
crawling then and output everything to a pager.
2014-11-20 00:01:05 +01:00
Lennart Poettering
d0b2babf52 busctl: improve output of service creds 2014-11-20 00:01:05 +01:00
Lennart Poettering
0171da06ef busctl: add new "introspect" verb for introspecting objects 2014-11-20 00:01:05 +01:00
Lennart Poettering
9b772efb41 sd-bus: refuse properties that claim to be both writable and constant at the same time 2014-11-20 00:01:05 +01:00
Lennart Poettering
a1ad376761 busctl: split out introspection parser from tree logic so that we can reuse it for a future "busctl introspect" command 2014-11-20 00:01:05 +01:00
Susant Sahani
3aeaee978a bus-socket: fix CID#996290 Unchecked return value 2014-11-17 11:00:14 +01:00
Lennart Poettering
f5d8989ce5 bus-proxy: properly check for bus name prefixes when enforcing policy 2014-11-14 20:06:01 +01:00
Lennart Poettering
d55192add7 busctl: introduce busctl "get-property" command for reading and dumping object properties 2014-11-14 17:52:40 +01:00
Lennart Poettering
56c8b52d4d busctl: various tweaks to "busctl tree" output 2014-11-14 13:18:51 +01:00
Lennart Poettering
781fa93815 busctl: add new "call" command to invoke methods on a service 2014-11-14 13:18:51 +01:00
Lennart Poettering
8022212b3b sd-bus: add sd_bus_message_is_empty() for checking whether a message carries any body 2014-11-14 13:18:51 +01:00
Daniel Mack
63cc4c3138 sd-bus: sync with kdbus upstream (ABI break)
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-13 20:41:52 +01:00
Daniel Mack
e9730b7690 sd-bus: pass attach flags to BUS_CREATOR_INFO
kdbus learned parsing the attach flags for the KDBUS_CMD_BUS_CREATOR_INFO
ioctl. Bits not set in this mask will not be exported. Set that field to
_KDBUS_ATTACH_ALL for now.

Signed-off-by: Daniel Mack <daniel@zonque.org>
2014-11-11 18:31:11 +01:00
Daniel Mack
022fb8558e sd-bus: add sd_bus_message.verify_destination_id and .destination_ptr
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-11 14:14:01 +01:00
Lennart Poettering
27e9c5af81 bus: when dumping string property values escape the chars we use as end-of-line and end-of-item marks 2014-11-10 20:54:45 +01:00
Lennart Poettering
d9130355ee busctl: add "tree" command to explore object trees 2014-11-10 19:25:29 +01:00
Lennart Poettering
6f5c810ad6 sd-bus: by default allow all creds to be passed along 2014-11-05 18:54:50 +01:00
Daniel Mack
d704fda934 sd-bus: sync up with new kdbus metadata attachment logic (ABI break)
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-05 14:48:20 +01:00
Lennart Poettering
f7fce3454c sd-bus: rename sd_bus_get_server_id() to sd_bus_get_owner_id()
In kdbus a "server id" is mostly a misnomer, as there isn't any "server"
involved anymore. Let's rename this to "owner" id hence, since it is an
ID that is picked by the owner of a bus or direct connection. This
matches nicely the sd_bus_get_owner_creds() call we already have.
2014-11-04 18:09:19 +01:00