Commit graph

72 commits

Author SHA1 Message Date
Lennart Poettering 693eb9a2d4 bus: rename message "serial" to "cookie"
Even if the lower-leveld dbus1 protocol calls it "serial", let's expose
the word "cookie" for this instead, as this is what kdbus uses and since
it doesn't imply monotonicity the same way "serial" does.
2013-12-25 18:04:04 +01:00
Lennart Poettering 751bc6ac79 bus: properly shift cgroup data returned from kdbus by the container's root before parsing 2013-12-24 19:31:44 +01:00
Lennart Poettering 2dc9970bed bus: only accept kdbus creds if they are valid
This allows userspace to fake kdbus creds via struct ucred in the proxy,
without making the recieving side choke on the missing fields of the
kdbus struct, more precisel pid_starttime and tid
2013-12-24 16:20:47 +01:00
Lennart Poettering 85feb8e4d9 bus: don't attach KDBUS_ITEM_ID to match ioctl() if we don't need it 2013-12-23 22:32:33 +01:00
Lennart Poettering d711a95778 bus: fix sender match creation on kdbus 2013-12-23 21:55:27 +01:00
Kay Sievers 98531b5762 bus: update kdbus.h 2013-12-23 19:15:33 +01:00
Lennart Poettering cd789fdf45 bus: always talk to the full dbus driver object 2013-12-23 04:20:55 +01:00
Lennart Poettering dff91e8b7f bus: use memcpy() rather than unbounded strcpy() 2013-12-23 04:20:55 +01:00
Lennart Poettering c20733832f bus: when getting credentials of a bus name that is activatable but not activated, say we don't have anything. 2013-12-21 23:21:31 +01:00
Lennart Poettering 0721804f03 bus: send status message from proxyd to systemd about client we are working for 2013-12-21 05:15:09 +01:00
Lennart Poettering 85a0aa17dd bus: when watching bus names, we always need to add a change match
Since for the kernel change of ownership of a name between starter and
real client is a change and for userspace thats addition/removal, we
need to unconditionally subscribe to these change events.
2013-12-21 01:02:23 +01:00
Daniel Mack 5a884f93fd libsystemd-bus: match on any connection ID unless specified 2013-12-20 23:12:42 +01:00
Daniel Mack 73842d62d7 libsystemd-bus: follow changes in kdbus
In particular, the match interface has seen a major overhaul.
2013-12-20 20:57:20 +01:00
Lennart Poettering ff2ea19264 bus: reenable id change subscriptions 2013-12-19 22:18:39 +01:00
Kay Sievers 8da4de0376 bus: do not add empty strings, size should be 0 2013-12-19 06:56:53 +01:00
Lennart Poettering 53461b74df driverd: implement AddMatch/RemoveMatch logic 2013-12-19 04:40:56 +01:00
Lennart Poettering 45fd5e4d08 bus: when releasing, taking, listing bus names check if they are valid
Given that the kernel does not validate bus names we have to when using
them.
2013-12-18 02:54:16 +01:00
Daniel Mack ceceaf09f9 bus: sync with kdbus
Two new things here:

a) struct kdbus_notify_name_change now carries two struct
   kdbus_notify_id_change

b) a new KDBUS_CMD_BYEBYE ioctl that has no user yet in systemd
2013-12-18 00:20:55 +01:00
Lukasz Skalski 043ccd8383 libsystemd-bus: the same error codes for sd_bus_release_name() (for kdbus and dbus1)
Due to this patch, sd_bus_release_name() function
returns the same code errors for kdbus and dbus1
if we try release non-existing name or foreign
name.
2013-12-13 15:50:41 +01:00
Lennart Poettering 33cb6e7934 bus: properly parse NameOwnerChanged messages when caller explicitly wants to match against names coming/going 2013-12-13 04:06:43 +01:00
Kay Sievers 07442efff8 bus: update kdbus.h 2013-12-12 20:19:12 +01:00
Lennart Poettering 29a07cdb4a bus: instead of exposing the dbus1 flags when acquiring a name use our own that are closer to kdbus
This turns around DO_NOT_QUEUE into QUEUE which implies a more useful
default. (And negative options are awful anyway.)
2013-12-12 05:55:58 +01:00
Lennart Poettering 7f7030e23e bus: update name listing logic to current kernel interface 2013-12-12 00:35:23 +01:00
Lennart Poettering 80514f9c9b macro: log assertion at debug level in assert_return() 2013-12-10 17:01:10 +00:00
Kay Sievers a8d4cac55c bus: catch up with latest kdbus changes 2013-12-06 14:31:43 +01:00
Kay Sievers 65dae17a2f bus: switch to multiple KDBUS_ITEM_NAME including the flags 2013-12-05 00:22:28 +01:00
Kay Sievers f7d8595113 libsystemd-bus: catch up with latest kdbus changes 2013-12-04 19:07:10 +01:00
Kay Sievers e63bb33d71 libsystemd-bus: catch up with latest kdbus list query changes 2013-12-04 11:47:22 +01:00
Lennart Poettering c0a0913218 bus: fix parsing of AcquireName() response 2013-12-03 20:31:34 +01:00
Lennart Poettering 71f2ab468d bus: rework sd_bus_list_names() to return two lists for acquired and activatable names 2013-12-03 18:42:51 +01:00
Lennart Poettering 0461f8cdc1 bus: internalize a lot of protocol definitions
We shouldn export what isn't necessary or useful to clients, so let's
add the protocol definitions we only need internally into a private
header.
2013-12-03 18:14:50 +01:00
Lennart Poettering e7176abbe8 bus: make sd_bus_request_name() and sd_bus_release_name() behave more like other calls
Instead of returning an enum of return codes, make them return error
codes like kdbus does internally.

Also, document this behaviour so that clients can stick to it.

(Also rework bus-control.c to always have to functions for dbus1 vs.
kernel implementation of the various calls.)
2013-12-03 18:02:46 +01:00
Daniel Mack 89fbb95e03 libsystemd-bus: catch up with latest kdbus changes 2013-12-03 14:38:53 +01:00
Daniel Mack 144e9e5890 libsystemd-bus: catch up with latest kdbus changes 2013-12-03 01:56:20 +01:00
Daniel Mack c85a5a243b libsystemd-bus: catch up with latest kdbus changes 2013-12-02 20:29:58 +01:00
Lennart Poettering 95c4fe8271 busctl: add command to dump creds of a peer or pid
(also, rename _SD_BUS_CREDS_MAX to _SD_BUX_CRED_ALL, since "MAX" so far
was used to indicate one higher than the highest valid value, and this
is not correct here.)
2013-12-02 18:40:43 +01:00
Lennart Poettering 006a0b8788 bus: be nice to LLVM and don't embedd a VLA in a union 2013-12-02 17:17:29 +01:00
Thomas Hindoe Paaboel Andersen 7c8e83c6d8 bus: remove unused variable 2013-12-01 00:26:08 +01:00
Kay Sievers 98a4025806 bus: catch up with kdbus 2013-11-30 20:41:02 +01:00
Lennart Poettering 49b832c5b8 bus: include unique and well known names in credentials object 2013-11-30 14:46:14 +01:00
Daniel Mack 1d0e3c9884 libsystemd-bus: catch up with latest kdbus changes
The name list and query functions now work differently in kdbus, as the
result is stored in the connection's pool, rather than being copied back
through the ioctl buffer. That also safes us some logic, as we don't
have to resize the communication buffer in a loop with growing buffer
sizes.

Due to this, KDBUS_CMD_MSG_RELEASE was renamed to KDBUS_CMD_FREE, as it
is now used outside the message logic as well.
2013-11-30 13:31:04 +01:00
Daniel Mack 3519d4c895 libsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags() 2013-11-29 22:01:34 +01:00
Daniel Mack 6018903565 libsystemd-bus: add kdbus support for sd_bus_get_owner() 2013-11-29 22:01:34 +01:00
Daniel Mack c931748d20 libsystemd-bus: factor out DBus bits out of sd_bus_get_owner()
Just a preparation for upcoming kdbus support.
2013-11-29 22:01:34 +01:00
Kay Sievers c6dfb87f1d bus: fix size calculation for match data 2013-11-29 21:03:54 +01:00
Lennart Poettering 777d7a6123 kdbus: synthesize NameOwnerChange signals from kernel messages and support matches against NameOwnerChange 2013-11-29 20:14:11 +01:00
Lukasz Skalski 9bb058a1e0 libsystemd-bus: clean up bus-control.c file 2013-11-29 19:08:51 +01:00
Daniel Mack ed99569df8 libsystemd-bus: sd_bus_request_name: fix return value for kdbus
kdbus returns -EALREADY if the requesting connection is already the
owner of a name, and -EEXIST if the name already exists and the
connection is not able to take it over.

Also, n->flags needs a translation as well to match the SD_BUS_* enum
values.
2013-11-29 14:06:50 +01:00
Daniel Mack b6bd53c1ee libsystemd-bus: make sd_bus_list_names return all connections, including unique names 2013-11-29 14:06:50 +01:00
Daniel Mack b147398450 libsystemd-bus: add kdbus support for sd_bus_list_names()
kdbus will tell us the minimum buffer size it needs in case the default
8kb buffer doesn't suffice.
2013-11-29 14:06:49 +01:00