summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
AgeCommit message (Collapse)Author
2013-12-05bus: add missing LE meta data enforcement for gvariant serializerLennart Poettering
2013-12-05bus: add support for serializing to gvariantLennart Poettering
(deserialization is still missing, hence this is not hooked up to kdbus)
2013-12-03bus: internalize a lot of protocol definitionsLennart Poettering
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-02bus: when replying to an incoming message and the vtable contains the ↵Lennart Poettering
expected return signature generate an error if the response message doesn't match it
2013-11-30bus: support temporarily const errors that don't need to be freed but ↵Lennart Poettering
require deep copies This should fix issues with incorrectly copying bus error messages out of sd_bus_message objects. Original bug found by: Djalal Harouni
2013-11-30bus: include unique and well known names in credentials objectLennart Poettering
2013-11-30libsystemd-bus: catch up with latest kdbus changesDaniel Mack
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-29bus: when turning a buffer into a sd_bus_message avoid creating zero-length ↵Lennart Poettering
parts
2013-11-28bus: add new sd_bus_creds object to encapsulate process credentialsLennart Poettering
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-22bus: rework sd_bus_error APIsLennart Poettering
All calls that set a sd_bus_error structure will now return the same error converted to a negative errno. This may be used as syntactic sugar to return from a function and setting a bus_error structure in one go. Also, translate all Linux Exyz (EIO, EINVAL, EUCLEAN, EPIPE, ...) automatically into counterparts in the (new) "Posix.Error." namespace. If we fail to allocate memory for the components of a sd_bus_error automatically reset it to an OOM error which we always can write.
2013-11-22bus: add calls to query attached objectsLennart Poettering
2013-11-21bus: rework message handlers to always take an error argumentLennart Poettering
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-21bus: the :no-sender hack is now unnecessary, since the new library doesn't ↵Lennart Poettering
require this anymore
2013-11-21bus: let's simplify things by getting rid of unnecessary bus parametersLennart Poettering
2013-11-20core: convert PID 1 to libsystemd-busLennart Poettering
This patch converts PID 1 to libsystemd-bus and thus drops the dependency on libdbus. The only remaining code using libdbus is a test case that validates our bus marshalling against libdbus' marshalling, and this dependency can be turned off. This patch also adds a couple of things to libsystem-bus, that are necessary to make the port work: - Synthesizing of "Disconnected" messages when bus connections are severed. - Support for attaching multiple vtables for the same interface on the same path. This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus calls which used an inappropriate signature. As a side effect we will now generate PropertiesChanged messages which carry property contents, rather than just invalidation information.
2013-11-12bus: beautify bus_message_dump() output a bitLennart Poettering
2013-11-12bus: add api to control auto start message flagLennart Poettering
2013-11-11bus: add APIs for adding iovecs to messages as string or arraysLennart Poettering
2013-11-10bus: use ENXIO as error condition when trying to exit a container when we ↵Lennart Poettering
are not in any So far we used ENXIO whenever the user tried to read something from a function that didn't carry the right type, and hence use the same error here to indicate that what the user expected and what was in the message didn't match up.
2013-11-09systemctl: make sure daemon-reload returns successZbigniew Jędrzejewski-Szmek
Also change sd_bus_message_exit_container to return -ENOENT when not in a container, to make it easier to distinguish different errors.
2013-11-09bus: let magic ":no-sender" pass the validationKay Sievers
2013-11-07bus: mark sd_bus_message_at_end publicMarc-Antoine Perennou
2013-11-07bus: bus_message_read_strv_extend() should return 1 on successLennart Poettering
Like all other message read calls bus_message_read_strv_extend() needs to return 1 on sucess, and 0 on end of array.
2013-11-07bus: fix output of bus_message_dump()Lennart Poettering
2013-11-07bus: allow reading empty arrays with sd_bus_message_read_array()Lennart Poettering
2013-11-07bus: also check for NULL when appending trivial typesLennart Poettering
2013-11-07bus: message_append_basic() - allow string == NULLKay Sievers
2013-11-07consistently use "int" when retrieving "bool" from bus messagesKay Sievers
2013-11-06bus: add forgotten _public_Zbigniew Jędrzejewski-Szmek
2013-11-06bus: export libsystemd-bus as a public libraryZbigniew Jędrzejewski-Szmek
Old static libsystemd-bus.la becomes libsystemd-bus-internal.la. memfd functions are also exported in the same library. (Best viewed with --color-words -U0).
2013-11-06bus: handle serialization of NULL stringsLennart Poettering
Instead of simply crashing be somewhat nicer and serialize a NULL string into the empty string and generate an error on signature and object path strings.
2013-11-05bus: add new bus API call sd_bus_message_at_end()Lennart Poettering
This may be used to determine whether we are at the end of a container ot the entire message.
2013-11-05bus: make use of assert_return() in all API calls that don't use it yetLennart Poettering
2013-11-05bus: add sd_bus_message_read_strv()Marc-Antoine Perennou
It will be useful to have that in the public API.
2013-11-05bus: support entering containers without specifying the typeLennart Poettering
On request om Tom Gundersen...
2013-11-05bus: add sd_bus_message_skip() to skip over multiple fieldsLennart Poettering
2013-11-05bus: allow that if the destination pointer in sd_bus_message_read_basic() is ↵Lennart Poettering
NULL we skip over a field
2013-10-30bus: make bus message dump output a bit smallerLennart Poettering
2013-10-29bus: add extra validity checksLennart Poettering
2013-10-29bus: add new sd_bus_message_verify_type() and sd_bus_message_copy() API callsLennart Poettering
2013-10-22bus: only if the user tries to read over the end of an array we should ↵Lennart Poettering
handle this as EOF
2013-10-22bus: avoid 'bool' storage when retrieving 'b' from the messageKay Sievers
Just use an unsigned int as a bool type to avoid issues in the public message reading API; sizeof(bool) == 1, but the code copies 4 bytes at the pointers destination.
2013-10-18bus: if we hit the end of an array container return 0 as EOF indicator when ↵Lennart Poettering
reading it
2013-10-16timedated: use libsystemd-bus instead of libdbus for bus communicationLennart Poettering
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-13bus: make sure we don't try to malloc 0 bytesZbigniew Jędrzejewski-Szmek
2013-10-13bus: fix access to unitialized variable in error pathZbigniew Jędrzejewski-Szmek
src/machine/machined-dbus.c:237:13: warning: Branch condition evaluates to a garbage value if (m) ^
2013-10-11bus: add sd_bus_message_append_strv() to easily add a NULL terminated string ↵Lennart Poettering
array to a message
2013-10-09bus: fix synthetic error messagesLennart Poettering
2013-10-09libsystemd-bus: add lightweight object vtable implementation for exposing ↵Lennart Poettering
objects on the bus This adds a lightweight scheme how to define interfaces in static fixed arrays which then can be easily registered on a bus connection. This makes it much easier to write bus services. This automatically handles implementation of the Properties, ObjectManager, and Introspection bus interfaces.
2013-06-04bus: unmap memfd retrieved from the memfd cacheKay Sievers