Re: PATCH: smart symlink loop detection.

C. Scott Ananian (cananian@lcs.mit.edu)
Tue, 14 Apr 1998 13:43:50 -0400 (EDT)


On Tue, 14 Apr 1998, Linus Torvalds wrote:

> On Tue, 14 Apr 1998, C. Scott Ananian wrote:
> >
> > The attached patch replaces the hard-coded 5-symlink nesting limit with
> > an implementation of Tarjan's algorithm to accurately and exactly detect
> > symlink loops.
>
> Hmm.. This is still recursive, and as such following a really deeply
> nested link will trash the kernel stack.

You're right, of course.

> Essentially, what your patch does is to just remove the tail-recursion,
> which may be a good thing to do in itself, but it doesn't remove the
> mid-recursion.

Let me think more about this and see if I can't come up with a more
elegant solution. [I can't believe I overlooked the mid-recursion.]
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian

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