This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Should we have MAXSYMLINKS?




On Wed, 13 Jan 1999, Roland McGrath wrote:

> There has always been an explicit check in BSD for following more than
> MAXSYMLINKS links.  It is not expressing an implementation limit.  The
> limit is there to catch infinite recursions (ln -s foo foo).
> This is what the ELOOP error exists to report.

	Yes, indeed. I wrote that:
a) We have similar (see below) limit (5).
b) It is enforced in a single place.
c) It's low due to our implementation of namei() (recursive vs.
iterative).

My fault, I didn't check the actual code before posting. Yes, 4.4 counts
total amount of symlinks (kern/vfs_lookup.c::namei()), but IMHO it is not
clear that we should do the same. Counting nested symlinks is enough for
loop detection. Anyway, if we want to enforce such limit we can do it in
do_follow_link() and lookup_dentry(). 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]