2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 22:05:27 +00:00

Don't use the parser time stamp to determine if policy is newer.

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@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
John Johansen
2014-04-23 11:01:33 -07:00
parent d05313f555
commit 6ecf828a13
2 changed files with 3 additions and 10 deletions

View File

@@ -996,7 +996,6 @@ int process_profile(int option, const char *profilename)
char * cachename = NULL;
char * cachetemp = NULL;
const char *basename = NULL;
FILE *cmd;
/* per-profile states */
force_complain = opt_force_complain;
@@ -1044,12 +1043,6 @@ int process_profile(int option, const char *profilename)
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;

View File

@@ -328,8 +328,8 @@ class AAParserCachingTests(AAParserCachingCommon):
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 @@ class AAParserCachingTests(AAParserCachingCommon):
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):