s4-libnet: Add messages to object count mismatch failures
authorAndrew Bartlett <abartlet@samba.org>
Tue, 20 Sep 2022 01:37:30 +0000 (13:37 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 4 Oct 2022 02:48:37 +0000 (02:48 +0000)
This helps explain these better than WERR_GEN_FAILURE.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15189

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/repl/replicated_objects.c

index de61d8e13350f11996f1073397cf1de829ba2bb4..6a07a88961bebcfe145872a27a7b81c39b000df9 100644 (file)
@@ -747,14 +747,25 @@ WERROR dsdb_replicated_objects_convert(struct ldb_context *ldb,
                /* Assuming we didn't skip or error, increment the number of objects */
                out->num_objects++;
        }
+
+       DBG_INFO("Proceesed %"PRIu32" DRS objects, saw %"PRIu32" objects "
+                "and expected %"PRIu32" objects\n",
+                out->num_objects, i, object_count);
+
        out->objects = talloc_realloc(out, out->objects,
                                      struct dsdb_extended_replicated_object,
                                      out->num_objects);
        if (out->num_objects != 0 && out->objects == NULL) {
+               DBG_ERR("FAILURE: talloc_realloc() failed after "
+                       "processing %"PRIu32" DRS objects!\n",
+                       out->num_objects);
                talloc_free(out);
                return WERR_FOOBAR;
        }
        if (i != object_count) {
+               DBG_ERR("FAILURE: saw %"PRIu32" DRS objects, server said we "
+                       "should expected to see %"PRIu32" objects!\n",
+                       i, object_count);
                talloc_free(out);
                return WERR_FOOBAR;
        }