mirror of
https://github.com/samba-team/samba.git
synced 2025-09-14 21:44:19 +03:00
s3:winbind: Code cleanup for initialize_winbindd_cache()
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
1d5c546c8e
commit
b7ac948645
@@ -3057,8 +3057,9 @@ static bool init_wcache(void)
|
|||||||
|
|
||||||
bool initialize_winbindd_cache(void)
|
bool initialize_winbindd_cache(void)
|
||||||
{
|
{
|
||||||
bool cache_bad = true;
|
bool cache_bad = false;
|
||||||
uint32_t vers;
|
uint32_t vers = 0;
|
||||||
|
bool ok;
|
||||||
|
|
||||||
if (!init_wcache()) {
|
if (!init_wcache()) {
|
||||||
DEBUG(0,("initialize_winbindd_cache: init_wcache failed.\n"));
|
DEBUG(0,("initialize_winbindd_cache: init_wcache failed.\n"));
|
||||||
@@ -3066,9 +3067,16 @@ bool initialize_winbindd_cache(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check version number. */
|
/* Check version number. */
|
||||||
if (tdb_fetch_uint32(wcache->tdb, WINBINDD_CACHE_VERSION_KEYSTR, &vers) &&
|
ok = tdb_fetch_uint32(wcache->tdb, WINBINDD_CACHE_VERSION_KEYSTR, &vers);
|
||||||
vers == WINBINDD_CACHE_VERSION) {
|
if (!ok) {
|
||||||
cache_bad = false;
|
DBG_DEBUG("Failed to get cache version\n");
|
||||||
|
cache_bad = true;
|
||||||
|
}
|
||||||
|
if (vers != WINBINDD_CACHE_VERSION) {
|
||||||
|
DBG_DEBUG("Invalid cache version %u != %u\n",
|
||||||
|
vers,
|
||||||
|
WINBINDD_CACHE_VERSION);
|
||||||
|
cache_bad = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cache_bad) {
|
if (cache_bad) {
|
||||||
|
Reference in New Issue
Block a user