lkml.org 
[lkml]   [2002]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectlimit of following symlinks
Date
Hi,

I'm using Linux-2.4.18 on some PC.
Linux-2.4.18 limits following sequential symlinks up to 5.
(All versions Linux-2.4 seem so.)
But the code and the comment of its code are different.
The comment tells the limit is 8, but the code seems to make the limit to 5.
Which should the limit be?
Here is the code.

linux/fs/namei.c:
/*
* This limits recursive symlink follows to 8, while
* limiting consecutive symlinks to 40.
*
* Without that kind of total limit, nasty chains of consecutive
* symlinks can cause almost arbitrarily long lookups.
*/
static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int err;
if (current->link_count >= 5)
goto loop;
if (current->total_link_count >= 40)
goto loop;


BTW, I always rewrite the code and change the limit to 20 because 5 is
too small for my project.
About Solaris, the limit is 20 and I'm happy on Solaris.
I hope the limit is grown to 20 on Linux.

I have not subscribed LKML, please CC me for reply.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.068 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site