Problems printing AF_UNIX sockaddrs

Neil Campbell lists at thebatcave.org.uk
Sat Aug 25 12:21:00 UTC 2007


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.

Cheers,
Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sockaddr_path.diff
Type: text/x-patch
Size: 4193 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20070825/c6d0b9e2/attachment.bin>


More information about the Strace-devel mailing list