Commit graph

29 commits

Author SHA1 Message Date
Tom Gundersen 6bb648a16a libsystemd-bus: rename to libsystemd
Documentation was updated to refer to either 'libsystemd' or 'sd-bus' in place
of libsystemd-bus.
2014-01-13 18:54:19 +01:00
Lennart Poettering 5b12334d35 bus: add new sd_bus_creds object to encapsulate process credentials
This way we can unify handling of credentials that are attached to
messages, or can be queried for bus name owners or connection peers.

This also adds the ability to extend incomplete credential information
with data from /proc,

Also, provide a convenience call that will automatically determine the
most appropriate credential object for an incoming message, by using the
the attached information if possible, the sending name information if
available and otherwise the peer's credentials.
2013-11-28 18:42:18 +01:00
Lennart Poettering ebcf1f97de bus: rework message handlers to always take an error argument
Message handler callbacks can be simplified drastically if the
dispatcher automatically replies to method calls if errors are returned.

Thus: add an sd_bus_error argument to all message handlers. When we
dispatch a message handler and it returns negative or a set sd_bus_error
we send this as message error back to the client. This means errors
returned by handlers by default are given back to clients instead of
rippling all the way up to the event loop, which is desirable to make
things robust.

As a side-effect we can now easily turn the SELinux checks into normal
function calls, since the method call dispatcher will generate the right
error replies automatically now.

Also, make sure we always pass the error structure to all property and
method handlers as last argument to follow the usual style of passing
variables for return values as last argument.
2013-11-21 21:12:36 +01:00
Lennart Poettering 14c24659cd bus: rename SD_BUS_ERROR_MAKE to SD_BUS_ERROR_MAKE_CONST to indicate it only works for const strings 2013-11-21 02:11:06 +01:00
Lennart Poettering df2d202e6e bus: let's simplify things by getting rid of unnecessary bus parameters 2013-11-21 02:07:35 +01:00
Lennart Poettering c49b30a235 bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()
The call is one of the most important ones we expose, where we place
major emphasis on. We should make sure to give it a short, memorable
name.
2013-11-12 00:12:43 +01:00
Zbigniew Jędrzejewski-Szmek 5a330cda0c pam_systemd: dup the fd received from logind
Otherwise sd_bus_message cleanup would close it.
2013-11-06 19:50:18 -05:00
Lennart Poettering 40ca29a137 timedated: use libsystemd-bus instead of libdbus for bus communication
Among other things this also adds a few things necessary for the change:

- Considerably more powerful error returning APIs in libsystemd-bus

- Adapter for connecting an sd_bus to an sd_event

- As I reworked the PolicyKit logic to the new library I also made it
  asynchronous, so that PolicyKit requests of one user cannot block out
  another user anymore.

- We always use the macro names for common bus error. That way it is
  harder to mistype them since the compiler will notice
2013-10-16 06:15:02 +02:00
Lennart Poettering 3a7d4f1ba4 bus: fix synthetic error messages 2013-10-09 03:29:20 +02:00
Lennart Poettering eb01ba5de1 bus: synthesize timeout message errors instead of returning error codes 2013-05-16 21:14:56 +02:00
Lennart Poettering 4a875b6133 kdbus: parse cgroup meta data, too 2013-04-15 01:51:37 +02:00
Zbigniew Jędrzejewski-Szmek e9b807c168 bus: remove two unused variables 2013-04-14 18:52:24 -04:00
Lennart Poettering 69aec65cf8 kdbus: parse even more kernel meta data fields 2013-04-13 21:53:11 +02:00
Lennart Poettering 1ef2af5ae0 bus: when we unmarshal an fd it should stay owned by the message object
If the user wants the fd to stay valid he should keep a reference to the
message object or duplicate the fd.

This unifies behaviour of demarshalling data fields and unix fds.
2013-04-10 23:23:19 +02:00
Lennart Poettering b7f247e0be bus: various improvements for test-bus-chat 2013-04-05 14:56:48 +02:00
Lennart Poettering d4100e2444 bus: convert a couple of calls over to new convenience functions 2013-04-05 14:56:48 +02:00
Lennart Poettering c784c5ce77 bus: use C99 struct construction for error initializers
That way we can allocate an error struct on-the-fly while calling a
function. Nice!
2013-04-05 13:12:11 +02:00
Lennart Poettering 98178d3947 bus: rename sd_bus_get_peer() to sd_bus_get_server_id()
This function always returns the server side ID. The name suggested it
was actually always the peer's ID, but that's not correct if the call is
called on a server bus context. Hence, let's correct the name a bit.
2013-03-31 16:46:21 +02:00
Lennart Poettering 392d5b378c bus: parse matches locally and allow registration of callbacks for them
This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.
2013-03-31 16:16:37 +02:00
Lennart Poettering 2181a7f558 bus: implement server mode, and anonymous authentication 2013-03-30 15:21:55 +01:00
Zbigniew Jędrzejewski-Szmek 49e5de64e2 tests: skip bus test if bus cannot be opened
To make the result more visible, special return value
is used to tell automake that the test was skipped. While
at it, use the same return value in other skipped tests.
2013-03-26 23:50:44 -04:00
Lennart Poettering 2c93b4efec bus: implement support for FD passing 2013-03-25 02:33:34 +01:00
Lennart Poettering a652755d2e bus: implement object handler registry 2013-03-22 15:46:49 +01:00
Lennart Poettering 2571ead1a6 bus: implicitly collect ucred/label information 2013-03-22 03:37:10 +01:00
Lennart Poettering 20902f3ec8 bus: also finish connection before returning from sd_bus_get_unique_name() 2013-03-22 03:37:10 +01:00
Lennart Poettering d728d708c3 bus: rework synchronization logic
Instead of allowing certain actions fail during authentication and
connection setup, implicitly synchronize on the connection to be set up
completely before returning.
2013-03-22 01:49:56 +01:00
Lennart Poettering b9bf7e2be9 bus: implicitly handle peer commands Ping() and GetMachineId() 2013-03-22 00:12:37 +01:00
Lennart Poettering e3017af973 bus: implement full method call timeout logic 2013-03-21 22:53:29 +01:00
Lennart Poettering 89ffcd2ad5 bus: hook up client with socket communication 2013-03-20 23:00:10 +01:00