[PATCH] ndrdump: Add the option --hex-input for hexdump parsing

Andrew Bartlett abartlet at samba.org
Tue Oct 11 22:40:21 UTC 2016


On Sun, 2016-10-09 at 23:22 +1300, Cody Harrington wrote:
> Hi all,
> 
> I wrote a patch for ndrdump that adds the option --hex-input, which 
> allows you to pass in a hexdump instead of a binary output for 
> debugging. This feature was originally suggested to me by Andrew
> Bartlett.
> 
> Please find the patch attached. The code was developed against the 
> master branch of the Github repository at the end of August. I've
> tested 
> merging the most recent version of master with these changes just
> now, 
> and there seem to be no conflicts.
> 
> This is my first time contributing, so a review and any feedback
> would 
> be greatly appreciated :^)

Thanks Cody!

Just some small details need to be fixed, as the patch is already in
pretty good style.
 
 - For comments, use
 
/*
 * My comment
 * across a few lines
 */

rather than

/* my comment
 * across a few lines
 */

 - There are a few chunks of just whitespace changes.  (If you want to
fix our whitespace, a separate patch lets us choose if we agree
distinct from the semantic changes).

 - DATA_BLOB ret_blob = {'\0'}

This looks wrong, you already initialise it later on, and the standard
way to zero that out is assigning with data_blob_zero, your current
code relies on promoting '\0' to 0 to NULL. 

 - A test is needed, see python/samba/tests/blackbox/ndrdump.py and
then use the file we supplied you.

Others may have some further comments, but this should get you started.

Thanks!

Andrew Bartlett

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   
https://catalyst.net.nz/services/samba







More information about the samba-technical mailing list