diff options
author | Stefan Metzmacher <metze@samba.org> | 2021-11-03 13:32:48 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2022-01-24 15:25:36 +0000 |
commit | d1a7f392a8ceef111a5d6c3d2a3bdb9dcb90db5e (patch) | |
tree | 7f682e9bbb1a5e9d91826a0bf361ebf27ccc5652 /librpc | |
parent | b489b7feda19b3c0f0fe2300f2c76d416776355b (diff) | |
download | samba-d1a7f392a8ceef111a5d6c3d2a3bdb9dcb90db5e.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>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/tools/ndrdump.c | 10 |
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); } } |