Subject: Re: How .. is resolved at mountpoints
To: None <email@example.com>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 03/16/2000 01:41:31
[ On Wednesday, March 15, 2000 at 21:35:56 (-0500), John Kohl wrote: ]
> Subject: Re: How .. is resolved at mountpoints
> >>>>> "JF" == Jonathan Fuerth <email@example.com> writes:
> JF> How does the kernel's pathname->(device, inode) algorithm work when a
> JF> pathname of ".." is given to it when the current directory is the top level
> JF> of a mounted filesystem (other than the root filesystem, of course).
> See /usr/src/sys/kern/vfs_lookup.c:namei().
> In there you'll find this notation:
> * Handle "..": two special cases.
> * 1. If at root directory (e.g. after chroot)
> * or at absolute root directory
> * then ignore it so can't get out.
Hmmm... why is there any thing special done when at the absolute root
directory? Isn't ".." still guaranteed to be just a hard link to "." in
the root directory (unless of course you are in fact chroot'ed).
Looking very briefly at the code I see that the elimination of this test
wouldn't likely make much difference of course, and keeping it will
obviate the need for worrying about the correctness of the ".."
directory entry in the absolute root....
Greg A. Woods
+1 416 218-0098 VE3TCP <firstname.lastname@example.org> <robohack!woods>
Planix, Inc. <email@example.com>; Secrets of the Weird <firstname.lastname@example.org>