svn commit: samba r23769 - 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
Mon Jul 9 15:34:47 GMT 2007


Author: obnox
Date: 2007-07-09 15:34:46 +0000 (Mon, 09 Jul 2007)
New Revision: 23769

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23769

Log:
Move removal of the tdb from the generic tdb_validate function
to the caller (winbindd_validate_cache in this case).
Next, there will be a backup handling for the tdb files.

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-07-09 14:43:36 UTC (rev 23768)
+++ branches/SAMBA_3_0/source/lib/util_tdb.c	2007-07-09 15:34:46 UTC (rev 23769)
@@ -1118,12 +1118,6 @@
 		DEBUGADD(10, (" => overall success: %s\n", v_status.success ? "yes" : "no"));
 	}
 
-	if (!v_status.success) {
-		DEBUG(10, ("tdb_validate: validation not successful.\n"));
-		DEBUGADD(10, ("removing tdb %s.\n", tdb_path));
-		unlink(tdb_path);
-	}
-
 	DEBUG(10, ("tdb_validate: waiting for child to finish...\n"));
 	while  ((wait_pid = sys_waitpid(child_pid, &child_status, 0)) < 0) {
 		if (errno == EINTR) {

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c	2007-07-09 14:43:36 UTC (rev 23768)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c	2007-07-09 15:34:46 UTC (rev 23769)
@@ -3304,6 +3304,12 @@
 	ret = tdb_validate(lock_path("winbindd_cache.tdb"),
 			   cache_traverse_validate_fn);
 
+	if (ret != 0) {
+		DEBUG(10, ("winbindd_validate_cache: validation not successful.\n"));
+		DEBUGADD(10, ("removing tdb %s.\n", tdb_path));
+		unlink(tdb_path);
+	}
+
 done:
 	DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
 	smb_panic_fn = smb_panic;

Modified: branches/SAMBA_3_0_26/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/util_tdb.c	2007-07-09 14:43:36 UTC (rev 23768)
+++ branches/SAMBA_3_0_26/source/lib/util_tdb.c	2007-07-09 15:34:46 UTC (rev 23769)
@@ -1118,12 +1118,6 @@
 		DEBUGADD(10, (" => overall success: %s\n", v_status.success ? "yes" : "no"));
 	}
 
-	if (!v_status.success) {
-		DEBUG(10, ("tdb_validate: validation not successful.\n"));
-		DEBUGADD(10, ("removing tdb %s.\n", tdb_path));
-		unlink(tdb_path);
-	}
-
 	DEBUG(10, ("tdb_validate: waiting for child to finish...\n"));
 	while  ((wait_pid = sys_waitpid(child_pid, &child_status, 0)) < 0) {
 		if (errno == EINTR) {

Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c	2007-07-09 14:43:36 UTC (rev 23768)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c	2007-07-09 15:34:46 UTC (rev 23769)
@@ -3304,6 +3304,12 @@
 	ret = tdb_validate(lock_path("winbindd_cache.tdb"),
 			   cache_traverse_validate_fn);
 
+	if (ret != 0) {
+		DEBUG(10, ("winbindd_validate_cache: validation not successful.\n"));
+		DEBUGADD(10, ("removing tdb %s.\n", tdb_path));
+		unlink(tdb_path);
+	}
+
 done:
 	DEBUG(10, ("winbindd_validate_cache: restoring panic function\n"));
 	smb_panic_fn = smb_panic;



More information about the samba-cvs mailing list