[apparmor] [patch 09/26] Dont use the parser time stamp to determine if policy is newer.

Seth Arnold seth.arnold at canonical.com
Thu Apr 17 06:00:50 UTC 2014


On Tue, Apr 15, 2014 at 10:22:16AM -0700, john.johansen at canonical.com wrote:
> Using the parser timestamp was a work around to force recompilation of
> policy that was built with a buggy parser. There are better ways to
> handle this so remove checking of the parser timestamp.
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
>  parser/parser_main.c  |    7 -------
>  parser/tst/caching.py |    6 +++---
>  2 files changed, 3 insertions(+), 10 deletions(-)
> 
> --- 2.9-test.orig/parser/parser_main.c
> +++ 2.9-test/parser/parser_main.c
> @@ -996,7 +996,6 @@
>  	char * cachename = NULL;
>  	char * cachetemp = NULL;
>  	const char *basename = NULL;
> -	FILE *cmd;
>  
>  	/* per-profile states */
>  	force_complain = opt_force_complain;
> @@ -1044,12 +1043,6 @@
>  		update_mru_tstamp(yyin);
>  	}
>  
> -	cmd = fopen("/proc/self/exe", "r");
> -	if (cmd) {
> -		update_mru_tstamp(cmd);
> -		fclose(cmd);
> -	}
> -
>  	retval = yyparse();
>  	if (retval != 0)
>  		goto out;
> --- 2.9-test.orig/parser/tst/caching.py
> +++ 2.9-test/parser/tst/caching.py
> @@ -328,8 +328,8 @@
>          cmd.extend(['-v', '-r', self.profile])
>          self.run_cmd_check(cmd, expected_string='Replacement succeeded for')
>  
> -    def test_parser_newer_skips_cache(self):
> -        '''test cache is skipped if parser is newer'''
> +    def test_parser_newer_uses_cache(self):
> +        '''test cache is not skipped if parser is newer'''
>  
>          self._generate_cache_file()
>          time.sleep(config.timeout)
> @@ -342,7 +342,7 @@
>          cmd = list(self.cmd_prefix)
>          cmd[0] = new_parser
>          cmd.extend(['-v', '-r', self.profile])
> -        self.run_cmd_check(cmd, expected_string='Replacement succeeded for')
> +        self.run_cmd_check(cmd, expected_string='Cached reload succeeded for')
>  
>      def _purge_cache_test(self, location):
>  
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140416/ef718040/attachment.pgp>


More information about the AppArmor mailing list