]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-bus/bus-message.c
sd-bus: introduce new match type "arg0has=" for matching arrays of strings 1036/head
authorLennart Poettering <lennart@poettering.net>
Tue, 25 Aug 2015 17:28:30 +0000 (19:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 Aug 2015 17:28:30 +0000 (19:28 +0200)
commiteccd47c5beb72211ce33c9a33a1bb36366d43e22
tree3efe52cf8e6cecdf358ae421752d70bb352165d4
parent33c1c9745ccc478c8eda72f8bae76945487076ae
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.
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/bus-match.c
src/libsystemd/sd-bus/bus-match.h
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-message.h
src/libsystemd/sd-bus/test-bus-kernel-bloom.c
src/libsystemd/sd-bus/test-bus-match.c