1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

s4-libnet: Add messages to object count mismatch failures

This helps explain these better than WERR_GEN_FAILURE.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15189
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>
(cherry picked from commit 483c48f52d6ff5e8149ed12bfeb2b6608c946f01)
This commit is contained in:
Andrew Bartlett 2022-09-20 13:37:30 +12:00 committed by Jule Anger
parent eb939d4b80
commit 7928376061

View 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;
}