Move removal of the tdb from the generic tdb_validate function
authorobnox <obnox@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Mon, 9 Jul 2007 15:34:46 +0000 (15:34 +0000)
committerobnox <obnox@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Mon, 9 Jul 2007 15:34:46 +0000 (15:34 +0000)
to the caller (winbindd_validate_cache in this case).
Next, there will be a backup handling for the tdb files.

Michael

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@23769 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/lib/util_tdb.c
source/nsswitch/winbindd_cache.c

index 5f9a5115b6bfc61070ad3aa35ff6aa399f419f59..564edffdac934ae8a063b56b99370cc6663b4b2b 100644 (file)
@@ -1118,12 +1118,6 @@ int tdb_validate(const char *tdb_path, tdb_validate_data_func validate_fn)
                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) {
index cfd182666e3072dd1ca8d8d91db72fdf712178d8..67d689a5f3ea641082d27242459a424449170268 100644 (file)
@@ -3304,6 +3304,12 @@ int winbindd_validate_cache(void)
        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;