]> git.pld-linux.org Git - packages/apparmor-parser.git/blob - apparmor-parser-cache-rebuild.patch
- updated URLs
[packages/apparmor-parser.git] / apparmor-parser-cache-rebuild.patch
1 diff -ur apparmor-2.12.org/parser/parser_main.c apparmor-2.12/parser/parser_main.c
2 --- apparmor-2.12.org/parser/parser_main.c      2017-12-24 09:48:31.000000000 +0100
3 +++ apparmor-2.12/parser/parser_main.c  2018-01-10 09:33:09.568033805 +0100
4 @@ -811,6 +811,8 @@
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,
13 diff -ur apparmor-2.12.org/parser/policy_cache.c apparmor-2.12/parser/policy_cache.c
14 --- apparmor-2.12.org/parser/policy_cache.c     2017-12-24 09:48:31.000000000 +0100
15 +++ apparmor-2.12/parser/policy_cache.c 2018-01-10 09:30:27.533641865 +0100
16 @@ -78,6 +78,15 @@
17         cache_tstamp = t;
18  }
19  
20 +void cache_tstamp_final_check(void)
21 +{
22 +       if (tstamp_cmp(cache_tstamp, mru_policy_tstamp) != 0) {
23 +               if (debug_cache)
24 +                       pwarn("%s: cache mtime is different than policy files mtimes\n", progname);
25 +               mru_skip_cache = 1;
26 +       }
27 +}
28 +
29  void update_mru_tstamp(FILE *file, const char *name)
30  {
31         struct stat stat_file;
32 diff -ur apparmor-2.12.org/parser/policy_cache.h apparmor-2.12/parser/policy_cache.h
33 --- apparmor-2.12.org/parser/policy_cache.h     2017-12-24 09:48:31.000000000 +0100
34 +++ apparmor-2.12/parser/policy_cache.h 2018-01-10 09:31:45.412419437 +0100
35 @@ -39,6 +39,7 @@
36  extern int debug_cache;
37  
38  void set_cache_tstamp(struct timespec t);
39 +void cache_tstamp_final_check(void);
40  void update_mru_tstamp(FILE *file, const char *path);
41  bool valid_cached_file_version(const char *cachename);
42  char *cache_filename(const char *cachedir, const char *basename);
This page took 0.088173 seconds and 3 git commands to generate.