summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
AgeCommit message (Collapse)Author
2014-01-13libsystemd-bus: rename to libsystemdTom Gundersen
Documentation was updated to refer to either 'libsystemd' or 'sd-bus' in place of libsystemd-bus.
2014-01-12bus: fix length calculation when serializing SD_BUS_TYPE_SIGNATUREKay Sievers
2013-12-25man: document sd_bus_message_get_cookie()Lennart Poettering
2013-12-25bus: rename message "serial" to "cookie"Lennart Poettering
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-24bus: allow peeking signatures recusively inside of containersLennart Poettering
Previously we invalidated the peeked signature as soon as the caller would recurse into a container, making stack based handling difficult. With this change we will keep the peeked signature around until the user advances to the next field.
2013-12-23bus: fix assert when serializing fixed size struct to gvariantLennart Poettering
2013-12-23bus-proxyd: synthesize NameAcquire/NameLost signals for socket clientsLennart Poettering
2013-12-21bus: refuse messages pretending to originate from local interfaceLennart Poettering
2013-12-18bus: reduce calls to KDBUS_CMD_MEMFD_SIZE_SET ioctlLennart Poettering
Instead of calling it for each buffer append, increase allocation exponentially and set the real value only at the end, when sealing off the memfd. This should drastically reduce the number of times we invoke the ioctl().
2013-12-17bus: remarshal messages when necessary before sendingLennart Poettering
2013-12-16bus: let's use GREEDY_REALLOC() when allocating space for containersLennart Poettering
2013-12-12bus: fix rewind logicLennart Poettering
2013-12-12bus: always pass valid timeout to kdbusLennart Poettering
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