diff options
Diffstat (limited to 'source3/winbindd/winbindd_cache.c')
-rw-r--r-- | source3/winbindd/winbindd_cache.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index 9c48c71aa2..c2ce0a2713 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -30,6 +30,7 @@ #include "../librpc/gen_ndr/ndr_wbint.h" #include "ads.h" #include "nss_info.h" +#include "../libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -105,35 +106,6 @@ void (*smb_panic_fn)(const char *const why) = smb_panic; static struct winbind_cache *wcache; -void winbindd_check_cache_size(time_t t) -{ - static time_t last_check_time; - struct stat st; - - if (last_check_time == (time_t)0) - last_check_time = t; - - if (t - last_check_time < 60 && t - last_check_time > 0) - return; - - if (wcache == NULL || wcache->tdb == NULL) { - DEBUG(0, ("Unable to check size of tdb cache - cache not open !\n")); - return; - } - - if (fstat(tdb_fd(wcache->tdb), &st) == -1) { - DEBUG(0, ("Unable to check size of tdb cache %s!\n", strerror(errno) )); - return; - } - - if (st.st_size > WINBINDD_MAX_CACHE_SIZE) { - DEBUG(10,("flushing cache due to size (%lu) > (%lu)\n", - (unsigned long)st.st_size, - (unsigned long)WINBINDD_MAX_CACHE_SIZE)); - wcache_flush_cache(); - } -} - /* get the winbind_cache structure */ static struct winbind_cache *get_cache(struct winbindd_domain *domain) { @@ -147,7 +119,7 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain) } if (strequal(domain->name, get_global_sam_name()) && - sid_equal(&domain->sid, get_global_sam_sid())) { + dom_sid_equal(&domain->sid, get_global_sam_sid())) { domain->backend = &sam_passdb_methods; domain->initialized = True; } @@ -673,7 +645,7 @@ static struct cache_entry *wcache_fetch_raw(char *kstr) static bool is_my_own_sam_domain(struct winbindd_domain *domain) { if (strequal(domain->name, get_global_sam_name()) && - sid_equal(&domain->sid, get_global_sam_sid())) { + dom_sid_equal(&domain->sid, get_global_sam_sid())) { return true; } @@ -683,7 +655,7 @@ static bool is_my_own_sam_domain(struct winbindd_domain *domain) static bool is_builtin_domain(struct winbindd_domain *domain) { if (strequal(domain->name, "BUILTIN") && - sid_equal(&domain->sid, &global_sid_Builtin)) { + dom_sid_equal(&domain->sid, &global_sid_Builtin)) { return true; } |