diff options
author | Kay Sievers <kay@vrfy.org> | 2015-01-09 18:46:08 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2015-01-09 18:46:08 +0100 |
commit | a2be9e047e6e0b243fe946f972d5d4d04db140e5 (patch) | |
tree | ad2ef645440b3e812e4ee70745db01a5b7fad3b7 /src/bus-proxyd | |
parent | fe21f16764147d51819a904d57ac36967f9913e3 (diff) |
bus-proxyd: xml - consider empty tags as recv
Diffstat (limited to 'src/bus-proxyd')
-rw-r--r-- | src/bus-proxyd/bus-xml-policy.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bus-proxyd/bus-xml-policy.c b/src/bus-proxyd/bus-xml-policy.c index 9e4cc454cf..58241038ea 100644 --- a/src/bus-proxyd/bus-xml-policy.c +++ b/src/bus-proxyd/bus-xml-policy.c @@ -280,7 +280,7 @@ static int file_load(Policy *p, const char *path) { else if (streq(name, "eavesdrop")) { log_debug("Unsupported attribute %s= at %s:%u, ignoring.", name, path, line); state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE; - ic = POLICY_ITEM_RECV; /* eavesdrop is a type of receive attribute match! */ + break; } else { log_error("Unknown attribute %s= at %s:%u, ignoring.", name, path, line); state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE; @@ -329,10 +329,9 @@ static int file_load(Policy *p, const char *path) { } else if (t == XML_TAG_CLOSE_EMPTY || (t == XML_TAG_CLOSE && streq(name, i->type == POLICY_ITEM_ALLOW ? "allow" : "deny"))) { - if (i->class == _POLICY_ITEM_CLASS_UNSET) { - log_error("Policy not set at %s:%u.", path, line); - return -EINVAL; - } + /* If the tag is fully empty so far, we consider it a recv */ + if (i->class == _POLICY_ITEM_CLASS_UNSET) + i->class = POLICY_ITEM_RECV; if (policy_category == POLICY_CATEGORY_DEFAULT) item_append(i, &p->default_items); |