Commit 3c7c255e authored by Alban Crequy's avatar Alban Crequy

policy: enforce policy on "allow own_prefix"

https://bugs.freedesktop.org/show_bug.cgi?id=46886
parent 5670dc6c
......@@ -1267,12 +1267,25 @@ bus_client_policy_check_can_own (BusClientPolicy *policy,
if (rule->type != BUS_POLICY_RULE_OWN)
continue;
if (rule->d.own.service_name != NULL)
if (!rule->d.own.prefix && rule->d.own.service_name != NULL)
{
if (!_dbus_string_equal_c_str (service_name,
rule->d.own.service_name))
continue;
}
else if (rule->d.own.prefix)
{
const char *data;
char next_char;
if (!_dbus_string_starts_with_c_str (service_name,
rule->d.own.service_name))
continue;
data = _dbus_string_get_const_data (service_name);
next_char = data[strlen (rule->d.own.service_name)];
if (next_char != '\0' && next_char != '.')
continue;
}
/* Use this rule */
allowed = rule->allow;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment