mirror of
https://github.com/samba-team/samba.git
synced 2025-02-09 09:57:48 +03:00
r23610: Move some winbindd_cache specific flags and actions
back to winbindd_cache.c. The generic mechanism should open the cache tdb readonly and with default flags. Michael (This used to be commit 062d8c61294a1e9f8588fa8af31954dd286c7bde)
This commit is contained in:
parent
75f6a458b5
commit
7c48598e86
@ -1005,12 +1005,7 @@ static int tdb_validate_child(const char *tdb_path,
|
|||||||
v_status.unknown_key = False;
|
v_status.unknown_key = False;
|
||||||
v_status.success = True;
|
v_status.success = True;
|
||||||
|
|
||||||
tdb = tdb_open_log(tdb_path,
|
tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDONLY, 0);
|
||||||
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
|
|
||||||
lp_winbind_offline_logon()
|
|
||||||
? TDB_DEFAULT
|
|
||||||
: (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
|
|
||||||
O_RDWR|O_CREAT, 0600);
|
|
||||||
if (!tdb) {
|
if (!tdb) {
|
||||||
v_status.tdb_error = True;
|
v_status.tdb_error = True;
|
||||||
v_status.success = False;
|
v_status.success = False;
|
||||||
@ -1182,4 +1177,3 @@ int tdb_validate(const char *tdb_path, tdb_validate_data_func validate_fn)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3279,14 +3279,32 @@ static void validate_panic(const char *const why)
|
|||||||
|
|
||||||
int winbindd_validate_cache(void)
|
int winbindd_validate_cache(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = -1;
|
||||||
|
const char *tdb_path = lock_path("winbindd_cache.tdb");
|
||||||
|
TDB_CONTEXT *tdb = NULL;
|
||||||
|
|
||||||
DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
|
DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
|
||||||
smb_panic_fn = validate_panic;
|
smb_panic_fn = validate_panic;
|
||||||
|
|
||||||
|
|
||||||
|
tdb = tdb_open_log(tdb_path,
|
||||||
|
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
|
||||||
|
( lp_winbind_offline_logon()
|
||||||
|
? TDB_DEFAULT
|
||||||
|
: TDB_DEFAULT | TDB_CLEAR_IF_FIRST ),
|
||||||
|
O_RDWR|O_CREAT,
|
||||||
|
0600);
|
||||||
|
if (!tdb) {
|
||||||
|
DEBUG(0, ("winbindd_validate_cache: "
|
||||||
|
"error opening/initializing tdb\n"));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
tdb_close(tdb);
|
||||||
|
|
||||||
ret = tdb_validate(lock_path("winbindd_cache.tdb"),
|
ret = tdb_validate(lock_path("winbindd_cache.tdb"),
|
||||||
cache_traverse_validate_fn);
|
cache_traverse_validate_fn);
|
||||||
|
|
||||||
|
done:
|
||||||
DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
|
DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
|
||||||
smb_panic_fn = smb_panic;
|
smb_panic_fn = smb_panic;
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user