summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
AgeCommit message (Collapse)Author
2013-12-10bus: when we _unref() a NULL pointer, don't use assert_return()Lennart Poettering
We support unreffing NULL pointers just fine and we shouldn't pay the _unlikely_() price for it, not get a debug message if we do, hence let's not use assert_return() here.
2013-12-10Revert "libsystemd-bus: use assert_return"Lennart Poettering
This reverts commit f7e2bd5a8070ba86cba6bcbf7d1c9a8173d846d4. Most of these checks are not programming errors, but happen during normal runtime. For example bus_kernel_pop_memfd() is called all the time on non-kdbus systems and is supposed to quickly fail if kdbus is not available. However, assert_return() makes this failure expensive, and hence has no place here. With the most recent change to assert_return() it will even log a debug message, which should never happen here.
2013-12-09libsystemd-bus: use assert_returnLukasz Skalski
2013-12-10bus: properly handle empty messagesLennart Poettering
2013-12-10bus: empty gvariant arrays should at least get size 1Lennart Poettering
2013-12-10bus: it's OK to send messages with an empty payload but non-empty signatureLennart Poettering
THis might happen when sending arrays with 0 enttries, hence this is not an indication for a problem.
2013-12-10bus: make gcc shut upLennart Poettering
2013-12-10bus: fix rewinding in gvariant messagesLennart Poettering
2013-12-10bus: fix signature handling when exiting containerLennart Poettering
2013-12-10bus: properly deserialize gvariant fixed size arraysLennart Poettering
2013-12-10bus: handler empty messages correctly when using gvariant marshallingLennart Poettering
2013-12-10bus: suppress creating empty parts in messagesLennart Poettering
2013-12-09bus: rely on explicit eof check instead of checking when mapping payloadLennart Poettering
This allows us to drop quite a bit of code.
2013-12-09bus: rearrange bus-message.c function order to keep read and write calls ↵Lennart Poettering
together
2013-12-09bus: demarshal gvariantLennart Poettering
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...