]>
Commit | Line | Data |
---|---|---|
e2dc7237 JR |
1 | diff -urNp -x '*.orig' apparmor-3.0.1.org/parser/parser_main.c apparmor-3.0.1/parser/parser_main.c |
2 | --- apparmor-3.0.1.org/parser/parser_main.c 2020-12-02 12:01:37.000000000 +0100 | |
3 | +++ apparmor-3.0.1/parser/parser_main.c 2021-04-01 22:28:09.569591753 +0200 | |
4 | @@ -1102,6 +1102,8 @@ int process_profile(int option, aa_kerne | |
70de829e AM |
5 | skip_cache = 1; |
6 | ||
7 | if (cachename) { | |
8 | + cache_tstamp_final_check(); | |
9 | + | |
10 | /* Load a binary cache if it exists and is newest */ | |
11 | if (cache_hit(cachename)) { | |
12 | retval = process_binary(option, kernel_interface, | |
e2dc7237 JR |
13 | diff -urNp -x '*.orig' apparmor-3.0.1.org/parser/policy_cache.c apparmor-3.0.1/parser/policy_cache.c |
14 | --- apparmor-3.0.1.org/parser/policy_cache.c 2020-12-02 12:01:37.000000000 +0100 | |
15 | +++ apparmor-3.0.1/parser/policy_cache.c 2021-04-01 22:28:09.569591753 +0200 | |
16 | @@ -75,6 +75,14 @@ void set_cache_tstamp(struct timespec t) | |
70de829e AM |
17 | cache_tstamp = t; |
18 | } | |
19 | ||
20 | +void cache_tstamp_final_check(void) | |
21 | +{ | |
22 | + if (tstamp_cmp(cache_tstamp, mru_policy_tstamp) != 0) { | |
ba03787f | 23 | + pwarn(WARN_CACHE, "%s: cache mtime is different than policy files mtimes\n", progname); |
70de829e AM |
24 | + mru_skip_cache = 1; |
25 | + } | |
26 | +} | |
27 | + | |
28 | void update_mru_tstamp(FILE *file, const char *name) | |
29 | { | |
30 | struct stat stat_file; | |
e2dc7237 JR |
31 | diff -urNp -x '*.orig' apparmor-3.0.1.org/parser/policy_cache.h apparmor-3.0.1/parser/policy_cache.h |
32 | --- apparmor-3.0.1.org/parser/policy_cache.h 2020-12-02 12:01:37.000000000 +0100 | |
33 | +++ apparmor-3.0.1/parser/policy_cache.h 2021-04-01 22:28:09.569591753 +0200 | |
34 | @@ -39,6 +39,7 @@ extern int mru_skip_cache; | |
70de829e AM |
35 | extern int debug_cache; |
36 | ||
37 | void set_cache_tstamp(struct timespec t); | |
38 | +void cache_tstamp_final_check(void); | |
39 | void update_mru_tstamp(FILE *file, const char *path); | |
40 | bool valid_cached_file_version(const char *cachename); | |
e2dc7237 | 41 | char *cache_filename(aa_policy_cache *pc, int dir, const char *basename); |