On Wed 18 Jun 2014 04:19:23 Dmitry V. Levin wrote:
> On Mon, Jun 16, 2014 at 10:47:05PM -0400, Mike Frysinger wrote:
> > On Sun 15 Jun 2014 09:14:05 [email protected] wrote:
> > > From: Zubin Mithra <[email protected]>
> 
> [...]
> 
> > > + ssize_t n;
> > > +
> > > + snprintf(linkpath, link_size, "/proc/%u/cwd", tcp->pid);
> > > + n = readlink(linkpath, cwd, MAXPATHLEN);
> > 
> > anytime you start using magic constant lengths for paths, you know you're
> > probably doing something wrong.  you have to remember that some systems
> > don't have a max path length restriction so these constants won't even be
> > defined.
>
> strace already uses MAXPATHLEN, e.g. in printpath(), so do we really want
> to support /proc/pid/cwd symlinks that are longer than MAXPATHLEN?
> If we do, then it should be implemented via realloc loop.
> If not, then we should handle this very unlikely case of
> readlink(MAXPATHLEN+1) returning a value greater than MAXPATHLEN,
> e.g. by treating it like readlink error.

i think existing cases of MAXPATHLEN should get fixed rather than extended
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to