chiark / gitweb /
bus: fix pattern matching
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 10 Jun 2015 17:34:05 +0000 (19:34 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:01:50 +0000 (10:01 +0100)
commit19a26b687fef2c7efce49a1aefd376427a14ab41
treedfb23fa0c463143d15000193e33ca9c6ee593a0b
parent0c92f823aefd539d59fe78f2ba0e75b80ef7f906
bus: fix pattern matching

DBus-spec defines two different pattern matchings:

  1) Path and namespace prefix matching. In this case, A matches B either
     if both are equal, or if B is fully included in the namespace of A.
     In other words, A has to be a prefix of B, but end with a separator
     character (or the following character in B must be one).

     This is used for path_namespace= and arg0namespace=

  2) The other pattern matching is used for arg0path= which does a two-way
     matching. That is, A must be a prefix of B, or B a prefix of A.
     Furthermore, the prefix must end with a separator.

Fix the sd-bus helpers to reflect that. The 'simple_' and 'complex_'
prefixes don't make any sense now, but.. eh..
src/libelogind/sd-bus/bus-internal.c
src/libelogind/sd-bus/test-bus-kernel-bloom.c
src/libelogind/sd-bus/test-bus-signature.c