svn commit: samba r23610 - in branches: SAMBA_3_0/source/lib
SAMBA_3_0/source/nsswitch SAMBA_3_0_26/source/lib
SAMBA_3_0_26/source/nsswitch
obnox at samba.org
obnox at samba.org
Tue Jun 26 13:45:09 GMT 2007
Author: obnox
Date: 2007-06-26 13:45:07 +0000 (Tue, 26 Jun 2007)
New Revision: 23610
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23610
Log:
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
Modified:
branches/SAMBA_3_0/source/lib/util_tdb.c
branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
branches/SAMBA_3_0_26/source/lib/util_tdb.c
branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_tdb.c 2007-06-26 10:19:06 UTC (rev 23609)
+++ branches/SAMBA_3_0/source/lib/util_tdb.c 2007-06-26 13:45:07 UTC (rev 23610)
@@ -1005,12 +1005,7 @@
v_status.unknown_key = False;
v_status.success = True;
- 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);
+ tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDONLY, 0);
if (!tdb) {
v_status.tdb_error = True;
v_status.success = False;
@@ -1182,4 +1177,3 @@
return ret;
}
-
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-06-26 10:19:06 UTC (rev 23609)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-06-26 13:45:07 UTC (rev 23610)
@@ -3279,14 +3279,32 @@
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"));
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"),
cache_traverse_validate_fn);
+done:
DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
smb_panic_fn = smb_panic;
return ret;
Modified: branches/SAMBA_3_0_26/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/util_tdb.c 2007-06-26 10:19:06 UTC (rev 23609)
+++ branches/SAMBA_3_0_26/source/lib/util_tdb.c 2007-06-26 13:45:07 UTC (rev 23610)
@@ -1005,12 +1005,7 @@
v_status.unknown_key = False;
v_status.success = True;
- 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);
+ tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDONLY, 0);
if (!tdb) {
v_status.tdb_error = True;
v_status.success = False;
@@ -1182,4 +1177,3 @@
return ret;
}
-
Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-06-26 10:19:06 UTC (rev 23609)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-06-26 13:45:07 UTC (rev 23610)
@@ -3279,14 +3279,32 @@
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"));
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"),
cache_traverse_validate_fn);
+done:
DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
smb_panic_fn = smb_panic;
return ret;
More information about the samba-cvs
mailing list