diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-26 21:15:39 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-26 21:15:39 +0100 |
commit | 278ebf8d26f0ebf9d63d8aa1b91a2adbdd8aa4e0 (patch) | |
tree | 0d67d0b6c40c3dc6631a68a37912408dc7cdfa97 /src/bus-proxyd/bus-policy.c | |
parent | 55e189007c707fb827b8b287903c258de234bd12 (diff) |
bus-policy: actually test messages against the newly added test.conf
Diffstat (limited to 'src/bus-proxyd/bus-policy.c')
-rw-r--r-- | src/bus-proxyd/bus-policy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bus-proxyd/bus-policy.c b/src/bus-proxyd/bus-policy.c index ff6a3e4e19..d543bf9af4 100644 --- a/src/bus-proxyd/bus-policy.c +++ b/src/bus-proxyd/bus-policy.c @@ -627,7 +627,7 @@ static int check_policy_item(PolicyItem *i, const struct policy_check_filter *fi if (i->name && !streq_ptr(i->name, filter->name)) break; - if ((i->message_type != _POLICY_ITEM_CLASS_UNSET) && (i->message_type != filter->message_type)) + if ((i->message_type != 0) && (i->message_type != filter->message_type)) break; if (i->path && !streq_ptr(i->path, filter->path)) @@ -688,7 +688,7 @@ static int check_policy_items(PolicyItem *items, const struct policy_check_filte * and the order of rules in policy definitions matters */ LIST_FOREACH(items, i, items) { if (i->class != filter->class && - IN_SET(i->class, POLICY_ITEM_OWN, POLICY_ITEM_OWN_PREFIX) != IN_SET(filter->class, POLICY_ITEM_OWN, POLICY_ITEM_OWN_PREFIX)) + !(i->class == POLICY_ITEM_OWN_PREFIX && filter->class == POLICY_ITEM_OWN)) continue; r = check_policy_item(i, filter); @@ -707,6 +707,8 @@ static int policy_check(Policy *p, const struct policy_check_filter *filter) { assert(p); assert(filter); + assert(IN_SET(filter->class, POLICY_ITEM_SEND, POLICY_ITEM_RECV, POLICY_ITEM_OWN, POLICY_ITEM_USER, POLICY_ITEM_GROUP)); + /* * The policy check is implemented by the following logic: * |