Subject: Re: bin/19377 (updated)
To: Emmanuel Dreyfus <manu@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 12/19/2002 14:53:17
On Thu, Dec 19, 2002 at 02:35:45PM +0100, Emmanuel Dreyfus wrote:
> On 12/17/2002 10:04:48, David Laight said:
> 
> > I've also realised that your handling of symlinks is definitely
> > incorrect.
> 
> I made a new patch which as far as I can test handles correctly symbolic 
> links. Would you like to peek at it? (it's in the PR)

Reads better...

You still want to use strlcpy() instead of strncpy().

I thought foe a while that:
+		if (tq[sz2 - 1] == '/')
+			tq[sz2--] = 0;
was badly wrong: would need to be tq[--sz2] = 0;
but the assignment is unnecessary.

I would be tempted to validate 'cached path' in cwd(),
eg wd=open(".",...) fstat(wd), open(cached_path), fstat()
and compare device and inode...

	David

-- 
David Laight: david@l8s.co.uk