Subject: Re: bin/19377
To: Emmanuel Dreyfus <manu@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 12/17/2002 10:04:48
> I'd like some review on bin/19377 before committing the fix...

I've also realised that your handling of symlinks is definitely
incorrect.

Assuming you are below a directory with 111 permissions so that
getcwd doesn't work, the equivalent of the following will be wrong:

command			cwd		cached_path
$ cd x			x		x
$ mkdir -p a1 a2/b2
$ ln -s ../a2/b2 a1/b2
$ cd a1			x/a1		x/a1
$ cd b2			x/a2/b2		x/a1/b2
$ cd ..			x/a2		x/a1

It probably wouldn't matter if the code traversed back over
the symlink when doing the 'cd ..' (aka ksh) but having the
current directory reported incorrectly is probably worse
than not being able too determine it.

	David

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