bus/policy: allow the empty prefix
Internally the empty prefix is treated specially as a wildcard, but handle this
correctly even if passed into policy_own_add_prefix().
@@ -151,6 +151,9 @@ static int policy_own_add_entry(CRBTree *policy, const char *name, bool deny, ui
}
int policy_own_add_prefix(PolicyOwn *policy, const char *prefix, bool deny, uint64_t priority) {
+ if (!strcmp(prefix, ""))
+ return error_trace(policy_own_set_wildcard(policy, deny, priority));
+ else
return error_trace(policy_own_add_entry(&policy->prefixes, prefix, deny, priority));
}
