Problems printing AF_UNIX sockaddrs

Neil Campbell lists at thebatcave.org.uk
Wed Sep 19 10:28:23 UTC 2007


Neil Campbell wrote:
> Hi,
> 
> I was tracing some applications and found that the output of strace
> included some non-printable characters, leading various tools such as
> 'file' and 'less' to refuse to recognise the file as text.  It seemed
> that this was due to some strange paths being included in unix domain
> sockaddr structs.
> 
> I've attached a patch which solves this issue for me, I'd be grateful
> for any feedback on it.  Essentially I've refactored printstr() and
> added a printstrn() function, and I'm now calling this rather than
> tprintf() to display the paths.  This takes care of escaping
> non-printable characters for me.
> 
> Please let me know what you think.

Hi again,

Did anyone have any thoughts on this patch?  If there are no problems
with it, I'd be keen to get it committed if possible.

Thanks,
Neil




More information about the Strace-devel mailing list