From 54d76c92868838e17d6aad0a3bb0cc7a5b11e35f Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Thu, 6 Mar 2014 22:42:42 +0100 Subject: busname: add parser for bus name policies There are three directives to specify bus name polices in .busname files: * AllowUser [username] [access] * AllowGroup [groupname] [access] * AllowWorld [access] Where [access] is one of * 'see': The user/group/world is allowed to see a name on the bus * 'talk': The user/group/world is allowed to talk to a name * 'own': The user/group/world is allowed to own a name There is no user added yet in this commit. --- src/core/busname.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/busname.c') diff --git a/src/core/busname.c b/src/core/busname.c index bca2145021..4806e741ca 100644 --- a/src/core/busname.c +++ b/src/core/busname.c @@ -553,6 +553,14 @@ static const char* const busname_result_table[_BUSNAME_RESULT_MAX] = { DEFINE_STRING_TABLE_LOOKUP(busname_result, BusNameResult); +static const char* const busname_policy_access_table[_BUSNAME_POLICY_ACCESS_MAX] = { + [BUSNAME_POLICY_ACCESS_SEE] = "see", + [BUSNAME_POLICY_ACCESS_TALK] = "talk", + [BUSNAME_POLICY_ACCESS_OWN] = "own", +}; + +DEFINE_STRING_TABLE_LOOKUP(busname_policy_access, BusNamePolicyAccess); + const UnitVTable busname_vtable = { .object_size = sizeof(BusName), -- cgit v1.2.3-54-g00ecf