Author: obnox
Date: 2007-07-17 13:06:29 +0000 (Tue, 17 Jul 2007)
New Revision: 23932

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

Log:
Fill extended status with information in case the validation traverse
functions did not do so but returned an error. (This is the case when
error occurred deeper than at the level of the content checking done by
the per entry validate_fn.)

Michael


Modified:
   branches/SAMBA_3_2/source/lib/util_tdb.c
   branches/SAMBA_3_2_0/source/lib/util_tdb.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_2/source/lib/util_tdb.c    2007-07-17 12:51:43 UTC (rev 
23931)
+++ branches/SAMBA_3_2/source/lib/util_tdb.c    2007-07-17 13:06:29 UTC (rev 
23932)
@@ -1021,8 +1021,12 @@
 
        /* Now traverse the tdb to validate it. */
        num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
-       if (num_entries == -1 || !(v_status.success)) {
+       if (!v_status.success) {
                goto out;
+       } else if (num_entries == -1) {
+               v_status.tdb_error = True;
+               v_status.success = False;
+               goto out;
        }
 
        DEBUG(10,("tdb_validate_child: tdb %s is good with %d entries\n",

Modified: branches/SAMBA_3_2_0/source/lib/util_tdb.c
===================================================================
--- branches/SAMBA_3_2_0/source/lib/util_tdb.c  2007-07-17 12:51:43 UTC (rev 
23931)
+++ branches/SAMBA_3_2_0/source/lib/util_tdb.c  2007-07-17 13:06:29 UTC (rev 
23932)
@@ -1021,8 +1021,12 @@
 
        /* Now traverse the tdb to validate it. */
        num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
-       if (num_entries == -1 || !(v_status.success)) {
+       if (!v_status.success) {
                goto out;
+       } else if (num_entries == -1) {
+               v_status.tdb_error = True;
+               v_status.success = False;
+               goto out;
        }
 
        DEBUG(10,("tdb_validate_child: tdb %s is good with %d entries\n",

Reply via email to