]> git.pld-linux.org Git - packages/apparmor-parser.git/blob - apparmor-parser-cache-rebuild.patch
Up to 3.1.6
[packages/apparmor-parser.git] / apparmor-parser-cache-rebuild.patch
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
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 -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)
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 +               pwarn(WARN_DEBUG_CACHE, "%s: cache mtime is different than policy files mtimes\n", progname);
24 +               mru_skip_cache = 1;
25 +       }
26 +}
27 +
28  void update_mru_tstamp(FILE *file, const char *name)
29  {
30         struct stat stat_file;
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 @@ -38,6 +38,7 @@ extern int create_cache_dir;          /* create
35  extern int mru_skip_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);
41  char *cache_filename(aa_policy_cache *pc, int dir, const char *basename);
This page took 0.056877 seconds and 3 git commands to generate.