[apparmor] [PATCH 1/3] Generate the features list from the features directory

John Johansen john.johansen at canonical.com
Wed Feb 22 23:22:14 UTC 2012


On 02/22/2012 03:18 PM, Kees Cook wrote:
> On Wed, Feb 22, 2012 at 03:04:56PM -0800, John Johansen wrote:
>> +static char *handle_features_dir(const char *filename, char **buffer, int size,
>> +				 char *pos)
>> [...]
>> +		flags_string = malloc(1024);
>> +		handle_features_dir(FLAGS_FILE, &flags_string, 2048, flags_string);
> 
> Shouldn't that 1024 be 2048, or vice versa?
> 
yep thanks

>> +		if (strstr(flags_string, "network"))
>> +			kernel_supports_network = 1;
>> +		if (strstr(flags_string, "mount"))
>> +			kernel_supports_mount = 1;
> 
> Looks like you were going for a more complex flags_string in the function,
> but then just did a quick check for things here instead?
> 
actually I was just leveraging the already existing flags_string that is used
to generate the flags set for the cache, and this is totally going for the
quick hack approach, as think we need to actually parser these things and
thats a bit much for this iteration.



More information about the AppArmor mailing list