Commit Graph

21 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek a132bef023 Drop kdbus bits
Some kdbus_flag and memfd related parts are left behind, because they
are entangled with the "legacy" dbus support.

test-bus-benchmark is switched to "manual". It was already broken before
(in the non-kdbus mode) but apparently nobody noticed. Hopefully it can
be fixed later.
2017-07-23 12:01:54 -04:00
Federico 19fe49f62c Export sd_bus_message_append_ap. It is renamed to sd_bus_message_appendv to follow systemd naming conventions. (#5753)
Moreover, man page for sd_bus_message_append is updated with reference to new exposed function.
Makefile-man is updated too, to reflect new alias.
2017-04-25 09:32:24 +02:00
Daniel Mack b26fa1a2fb tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Lennart Poettering 07630cea1f util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Lennart Poettering eccd47c5be sd-bus: introduce new match type "arg0has=" for matching arrays of strings
Previously, sd-bus inofficially already supported bus matches that
tested a string against an array of strings ("as"). This was done via an
enhanced way to interpret "arg0=" matches. This is problematic however,
since clients have no way to determine if their respective
implementation understood strv matches or not, thus allowing invalid
matches to be installed without a way to detect that.

This patch changes the logic to only allow such matches with a new
"arg0has=" syntax. This has the benefit that non-conforming
implementations will return a parse error and a client application may
thus efficiently detect support for the match type.

Matches of this type are useful for "udev"-like systems that "tag" objects
with a number of strings, and clients need to be able to match against
any of these "tags".

The name "has" takes inspiration from Python's ".has_key()" construct.
2015-08-25 19:28:30 +02:00
Lennart Poettering aa0d0ed6b8 sd-bus: remove ucred parameter from bus_message_from_header() since we don't use it anymore 2015-06-10 15:52:52 +02:00
Daniel Mack 2c35d880de sd-bus, shared: fix includes
Include <sys/socket.h> from util.h and bus-message.h in order to
build errors like the ones below on kdbus enabled systems.

./src/shared/util.h:976:32: warning: its scope is only this definition or declaration, which is probably not what you want
In file included from src/libsystemd/sd-bus/bus-kernel.c:37:0:
./src/shared/util.h:1081:28: warning: 'struct msghdr' declared inside parameter list
 void cmsg_close_all(struct msghdr *mh);
                            ^
  CC       src/libsystemd/sd-bus/libsystemd_la-bus-creds.lo
In file included from src/libsystemd/sd-bus/bus-creds.c:25:0:
./src/shared/util.h:976:32: warning: 'struct ucred' declared inside parameter list
 int getpeercred(int fd, struct ucred *ucred);
                                ^
2015-02-24 00:42:13 +01:00
Thomas Hindoe Paaboel Andersen 2eec67acbb remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
2015-02-23 23:53:42 +01:00
Lennart Poettering 2ac7c17f9d Revert "Revert "sd-bus: change serialization of kdbus messages to qualify in their entirety as gvariant objects""
This reverts commit 954871d8ba.
2015-02-16 15:03:44 +01:00
Kay Sievers 954871d8ba Revert "sd-bus: change serialization of kdbus messages to qualify in their entirety as gvariant objects"
This breaks booting with kdbus.

This reverts commit b381de4197.
2015-01-30 13:53:45 +01:00
Lennart Poettering b381de4197 sd-bus: change serialization of kdbus messages to qualify in their entirety as gvariant objects
Previously, we only minimally altered the dbus1 framing for kdbus, and
while the header and its fields where compliant Gvariant objects, and so
was the body, the entire message together was not.

As result of discussions with Ryan Lortie this is now changed, so that
the messages in there entirely are fully compliant GVariants. This
follows the framing description described here:

https://wiki.gnome.org/Projects/GLib/GDBus/Version2

Note that this change changes the framing of *all* messages sent via
kdbus, this means you have to reboot your kdbus system, after compiling
and installing this new version.
2015-01-26 21:52:07 +01:00
Lennart Poettering d29ae2914e sd-bus: unify how we set the sender of synthetic messages 2015-01-07 20:25:30 +01:00
Lennart Poettering 7dcd79c295 sd-bus: properly support passing memfds around with offset/size parameters 2014-12-09 18:07:46 +01:00
David Herrmann 77adde6382 bus: sync with kdbus-git (ABI break)
kdbus-git gained two new features:
 * memfd offsets: This allows to specify a 'start' offset in kdbus_memfd
                  so you can send partial memfd hunks instead of always
                  the full memfd
 * KDBUS_HELLO_UNPRIVILEGED: If passed during HELLO, the client will be
                             treated as unprivileged.
2014-12-09 11:14:55 +01:00
Lennart Poettering 22d097a6bb sd-bus: move packet header definition to bus-protocol.h 2014-11-28 21:12:03 +01:00
Lennart Poettering 198b158f49 sd-bus: add support for matches against arrays of strings in messages 2014-11-28 20:29:44 +01:00
Daniel Mack 022fb8558e sd-bus: add sd_bus_message.verify_destination_id and .destination_ptr
kdbus learned to accept both a numerical destination ID as well as a
well-known-name. In that case, kdbus makes sure that the numerical ID is in
fact the owner of the provided name and fails otherwise.

This allows for race-free assertion of a bus name owner while sending a
message, which is a requirement for bus-proxyd.

Add two new fields to sd_bus_message, and set the numerical ID to
verify_destination_id if bus_message_setup_kmsg() is called for a
message with a well-known name.

Also, set the destination's name in the kdbus item to .destination_ptr
if it is non-NULL.

Normal users should not touch these fields, and they're not publicy
accessible.
2014-11-11 14:14:01 +01:00
Lennart Poettering 42c4ebcbd4 sd-bus: don't look for a 64bit value when we only have 32bit value on reply cookie hash table access
This broke hashtable lookups for the message cookies on s390x, which is
a 64bit BE machine where accessing 32bit values as 64bit and vice versa
will explode.

Also, while we are at it, be a bit more careful when dealing with the
64bit cookies we expose and the 32bit serial numbers dbus uses in its
payload.

Problem identified by Fridrich Strba.
2014-03-13 20:33:22 +01:00
Lennart Poettering ca7b42c816 bus: expose priority field of messages, in preparation for prioq support 2014-01-22 20:01:23 +01:00
Lennart Poettering 6a0e376c1c bus: add API for querying the kdbus message sequence number 2014-01-22 11:19:26 +01:00
Tom Gundersen 607553f930 libsystemd: split up into subdirs
We still only produce on .so, but let's keep the sources separate to make things a bit
less messy.
2014-01-21 14:41:35 +01:00
Renamed from src/libsystemd/bus-message.h (Browse further)