config-parser: Clarify how <allow>, <deny> attributes work
authorSimon McVittie <smcv@collabora.com>
Wed, 31 May 2017 13:51:31 +0000 (14:51 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 28 Jul 2017 10:24:20 +0000 (11:24 +0100)
commit9f81acc004dd79c12b496fbfa2fc04afabd6fecf
treec1be26d0d0f96d783b5b2ce19aec4dd9c7356597
parentebc8fe8da25d70c488964de04d08ac511f403f4c
config-parser: Clarify how <allow>, <deny> attributes work

The giant conditionals used to check policy attributes are increasingly
unwieldy, so let's try something else. Bundle together the send_
attributes, the receive_ attributes, the eavesdrop attribute
(which can go on either send or receive rules) and the other attributes
into equivalence classes, and write the conditionals in terms of those
equivalence classes.

In particular, this correctly forbids
    <allow receive_type="..." send_destination="..."/>
which was previously allowed but nonsensical (the send part took
precedence and the receive part was ignored).

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
bus/config-parser.c