[apparmor] [patch 07/13] parser - fix --skip-bad-cache regression

John Johansen john.johansen at canonical.com
Mon Oct 14 08:52:05 UTC 2013


On 10/10/2013 01:46 PM, Steve Beattie wrote:
> Rev 2203 (rev 2097 on the 2.8 branch) created a regression such that
> cache files will be written out even if the '--skip-bad-cache' option
> is given and the cached features file differs from the features of
> the currently running kernel. The patch below fixes the regression.
> 
> (I acked this patch on list, but it has not been committed.)
> 
> From: John Johansen <john.johansen at canonical.com>
> Acked-by: Steve Beattie <steve at nxnw.org>

Sorry, committed now


> 
> ---
>  parser/parser_main.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: b/parser/parser_main.c
> ===================================================================
> --- a/parser/parser_main.c
> +++ b/parser/parser_main.c
> @@ -1122,7 +1122,7 @@ static int create_cache(const char *cach
>  	struct stat stat_file;
>  	FILE * f = NULL;
>  
> -	if (cond_clear_cache && clear_cache_files(cacheloc) != 0)
> +	if (clear_cache_files(cacheloc) != 0)
>  		goto error;
>  
>  create_file:
> @@ -1197,7 +1197,7 @@ static void setup_flags(void)
>  	get_flags_string(&cache_flags, cache_features_path);
>  	if (cache_flags) {
>  		if (strcmp(flags_string, cache_flags) != 0) {
> -			if (write_cache) {
> +			if (write_cache && cond_clear_cache) {
>  				if (create_cache(cacheloc, cache_features_path,
>  						 flags_string))
>  					skip_read_cache = 1;
> 
> 
> -- AppArmor mailing list AppArmor at lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 




More information about the AppArmor mailing list