|
Lines 71-76
Link Here
|
| 71 |
#include <stdbool.h> |
71 |
#include <stdbool.h> |
| 72 |
|
72 |
|
| 73 |
#include <univention/debug.h> |
73 |
#include <univention/debug.h> |
|
|
74 |
#include <univention/config.h> |
| 74 |
|
75 |
|
| 75 |
#include "common.h" |
76 |
#include "common.h" |
| 76 |
#include "cache.h" |
77 |
#include "cache.h" |
|
Lines 78-83
Link Here
|
| 78 |
#include "cache_entry.h" |
79 |
#include "cache_entry.h" |
| 79 |
#include "network.h" |
80 |
#include "network.h" |
| 80 |
#include "signals.h" |
81 |
#include "signals.h" |
|
|
82 |
#include "filter.h" |
| 83 |
#include "utils.h" |
| 81 |
|
84 |
|
| 82 |
#define MASTER_KEY "__master__" |
85 |
#define MASTER_KEY "__master__" |
| 83 |
#define MASTER_KEY_SIZE (sizeof MASTER_KEY) |
86 |
#define MASTER_KEY_SIZE (sizeof MASTER_KEY) |
|
Lines 94-99
DB_ENV *dbenvp;
Link Here
|
| 94 |
#endif |
97 |
#endif |
| 95 |
static FILE *lock_fp=NULL; |
98 |
static FILE *lock_fp=NULL; |
| 96 |
|
99 |
|
|
|
100 |
static struct filter cache_filter; |
| 101 |
static struct filter *cache_filters[] = {&cache_filter, NULL}; |
| 102 |
|
| 103 |
static void setup_cache_filter(void) { |
| 104 |
cache_filter.filter = univention_config_get_string("listener/cache/filter"); |
| 105 |
if (cache_filter.filter && cache_filter.filter[0]) { |
| 106 |
cache_filter.base = univention_config_get_string("ldap/base"); |
| 107 |
cache_filter.scope = LDAP_SCOPE_SUBTREE; |
| 108 |
} else { |
| 109 |
FREE(cache_filter.filter); |
| 110 |
FREE(cache_filter.base); |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 97 |
#ifdef WITH_DB42 |
114 |
#ifdef WITH_DB42 |
| 98 |
static void cache_panic_call(DB_ENV *dbenvp, int errval) |
115 |
static void cache_panic_call(DB_ENV *dbenvp, int errval) |
| 99 |
{ |
116 |
{ |
|
Lines 192-197
int cache_init(void)
Link Here
|
| 192 |
} |
209 |
} |
| 193 |
dbp->set_errcall(dbp, cache_error_message); |
210 |
dbp->set_errcall(dbp, cache_error_message); |
| 194 |
#endif |
211 |
#endif |
|
|
212 |
setup_cache_filter(); |
| 195 |
return 0; |
213 |
return 0; |
| 196 |
} |
214 |
} |
| 197 |
|
215 |
|
|
Lines 429-434
int cache_update_entry_lower(NotifierID id, char *dn, CacheEntry *entry)
Link Here
|
| 429 |
char *lower_dn; |
447 |
char *lower_dn; |
| 430 |
int rv = 0; |
448 |
int rv = 0; |
| 431 |
|
449 |
|
|
|
450 |
/* IN8 Issue 2387: Skip caching certain entries matching LDAP filter */ |
| 451 |
if (cache_filter.filter && cache_entry_ldap_filter_match(cache_filters, dn, entry)) |
| 452 |
return rv; |
| 453 |
|
| 432 |
lower_dn = _convert_to_lower(dn); |
454 |
lower_dn = _convert_to_lower(dn); |
| 433 |
rv = cache_update_entry(id, lower_dn, entry); |
455 |
rv = cache_update_entry(id, lower_dn, entry); |
| 434 |
|
456 |
|