summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2021-11-03 13:32:48 +0100
committerJule Anger <janger@samba.org>2022-01-30 10:57:11 +0000
commitc1bd0f0d5e3cc6da66e9241832ae29048c4cda40 (patch)
tree2b5d7b307b12824f05c3bf6ec2bd225db7cd0d1b /librpc
parent1538a574a22c2762ed322ffbf34f63ca872f034b (diff)
downloadsamba-c1bd0f0d5e3cc6da66e9241832ae29048c4cda40.tar.gz
ndrdump: make use of dump_data_file_diff() in order to show differences
This makes it much easier to detect differences in the given and generated buffers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14956 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit d1a7f392a8ceef111a5d6c3d2a3bdb9dcb90db5e)
Diffstat (limited to 'librpc')
-rw-r--r--librpc/tools/ndrdump.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index ed9198f145d..b5d7f4fa3f6 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -189,6 +189,13 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
dump_data_file(d, l, !force, stdout);
}
+static void ndrdump_data_diff(const uint8_t *d1, size_t l1,
+ const uint8_t *d2, size_t l2,
+ bool force)
+{
+ dump_data_file_diff(stdout, !force, d1, l1, d2, l2);
+}
+
static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
struct ndr_pull *ndr_pull,
struct ndr_print *ndr_print,
@@ -772,6 +779,9 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
printf("WARNING! orig and validated differ at byte 0x%02X (%u)\n", i, i);
printf("WARNING! orig byte[0x%02X] = 0x%02X validated byte[0x%02X] = 0x%02X\n",
i, byte_a, i, byte_b);
+ ndrdump_data_diff(blob.data, blob.length,
+ v_blob.data, v_blob.length,
+ dumpdata);
}
}