[apparmor] [patch 04/24] make the parse_sub_mode code more generic
John Johansen
john.johansen at canonical.com
Wed Mar 12 08:15:46 UTC 2014
On 03/11/2014 11:19 PM, Steve Beattie wrote:
> On Fri, Mar 07, 2014 at 09:31:25AM -0800, john.johansen at canonical.com wrote:
>> Make it more generic so that it can be shared with signals.
>>
>> Signed-off-by: John Johansen <john.johansen at canonical.com>
>
> So this looks good enough for Acked-by: Steve Beattie <steve at nxnw.org>,
> just one question:
>
>> +static int parse_X_sub_mode(const char *X, const char *str_mode, int *result, int fail, const char *mode_desc __unused)
>> +{
>> + int mode = 0;
>> + const char *p;
>> +
>> + PDEBUG("Parsing X mode: %s\n", X, str_mode);
>> +
>> + if (!str_mode)
>> + return 0;
>> +
>> + p = str_mode;
>> + while (*p) {
>> + char current = *p;
>> + char lower;
>> +
>> +reeval:
>> + switch (current) {
>> + case COD_READ_CHAR:
>> + PDEBUG("Parsing %s mode: found %s READ\n", X, mode_desc);
>> + mode |= AA_DBUS_RECEIVE;
>> + break;
>> +
>> + case COD_WRITE_CHAR:
>> + PDEBUG("Parsing %s mode: found %s WRITE\n", X,
>> + mode_desc);
>> + mode |= AA_DBUS_SEND;
>
> If this function is to be shared between dbus and signals, should
> AA_DBUS_RECEIVE and AA_DBUS SEND be morphed into something more generic?
> Or does that occur in the patch that introduces signal support?
>
Sigh, yeah we need to patch it into something more generic. Signal is
using it as AA_MAY_SEND, but they need to be explicitly tied.
More information about the AppArmor
mailing list