Re: smart symlink loop detection.

George Famelis (gf@eetaa.gr)
Tue, 21 Apr 1998 17:19:28 +0300


Hi

Back again, after the (Greek Orthodox) Pascha Holy Days ...

: C. Scott Ananian wrote:
> If a filename is a/b/c, and b is a symlink, you have mid-recursion, by
> definition. In order to turn mid-recursion into iteration, you need
> some sort of stack. You can keep the stack either a) explicitly,
> or b) in the pathname (maintain a string indicating which pathname
> components are yet to be resolved). Either way, you have a stack.

You are right. I am sorry :)

> I think by inventing nomenclature, you've managed to confuse the issue
> entirely.

Sorry if this didn't help. I was just trying to figure out which is the
exact problem I was talking about, and I was solving the wrong problem.
As Linus pointed out later, the problem is not to find a pathname.
There might not exist such a thing. I copy from linux-kernel-digest
#1854:
> In particular, for just about any virtual filesystem it makes a lot
> more sense to have a separate "follow-link" that has _nothing_ to do
> with looking up a pathname. For example, imagine a virtual "network
> connection" filesystem, where you can look up any open socket. The
> socket really doesn't have a path in the filesystem, but using a
> "link" (forget the word "symlink" because people are too fixated with
> traditional symlinks) to find the socket makes perfect sense.

: C. Scott Ananian wrote:
> I don't think your algorithm properly handles a/b/c, where b is a
> symlink. It appears that you lose the trailing portion and return the
> expansion of a/b.

Variable 'name', which is used as the last argument in SaveStr when
evaluating the link (b), always is the trailing portion (c) of a/b/c.

Regards,

George

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu