Pathnames followed by "..." when printed using printpathn

Dmitry V. Levin ldv at altlinux.org
Wed May 28 16:03:45 UTC 2014


On Tue, May 27, 2014 at 09:23:15AM +0530, Zubin Mithra wrote:
> Hello everyone,
> 
> Currently I'm working on a means by which I can convert relative paths to
> absolute when displayed as system call arguments. Some sample output can be
> seen here[1]. Please note that the arguments passed to "execve" and "open"
> are absolute paths.
> 
> (The current implementation is just a PoC and I haven't committed anything
> yet, I'll post a link to the commit as soon as I push it in.)
> 
> `printpathn` takes in an argument `n` which is the maximum number of
> characters that should be displayed in the path(followed by "...").
> 
> Should this scheme be followed when displaying absolute paths too?

printpathn is designed for printing paths, and paths cannot be longer than
MAXPATHLEN.  Longer arguments would result to ENAMETOOLONG anyway, so
there is no need to print more than MAXPATHLEN.  I think we should follow
this scheme no matter whether relative paths are converted to absolute or
not: if the path "passed" to printpathn is longer, ellipsis should be added.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140528/40de27e8/attachment.bin>


More information about the Strace-devel mailing list