[apparmor] [patch 12/16] Dont use the parser time stamp to determine if policy is newer.
john.johansen at canonical.com
john.johansen at canonical.com
Tue Feb 25 23:12:55 UTC 2014
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>
---
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):
More information about the AppArmor
mailing list