Messages in this thread Patch in this message | | | Date | Mon, 22 Nov 1999 13:49:42 +0100 (CET) | From | Johannes Kloos <> | Subject | [PATCH] Configure option for symlink depth |
| |
Hello everybody, I've written a small patch that allows you to set the maximum symlink depth as a configure option. It will probably not break anything, but if it causes bugs, I'd like to head about these. Btw: I think this should really go into /proc or so. -- Johannes Kloos --- linux/fs/namei.c.orig Sat Nov 13 10:16:13 1999 +++ linux/fs/namei.c Sun Nov 14 11:12:25 1999 @@ -17,6 +17,10 @@ #include <linux/smp_lock.h> #include <linux/quotaops.h> +#ifndef CONFIG_MAXLINKS +#defien CONFIG_MAXLINKS 5 +#endif + #include <asm/uaccess.h> #include <asm/unaligned.h> #include <asm/semaphore.h> @@ -81,6 +85,8 @@ * semantics. See the comments in "open_namei" and "do_link" below. * * [10-Sep-98 Alan Modra] Another symlink change. + * + * [13-Nov-99 Johannes Kloos] More symlink changes. */ /* In order to reduce some races, while at the same time doing additional @@ -268,7 +274,7 @@ if ((follow & LOOKUP_FOLLOW) && inode && inode->i_op && inode->i_op->follow_link) { - if (current->link_count < 5) { + if (current->link_count < CONFIG_MAXLINKS) { struct dentry * result; current->link_count++; --- linux/fs/Config.in.orig Fri Oct 1 16:58:19 1999 +++ linux/fs/Config.in Sun Nov 14 11:09:56 1999 @@ -5,6 +5,13 @@ comment 'Filesystems' bool 'Quota support' CONFIG_QUOTA + +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + int 'Maximum symlink depth' CONFIG_MAXLINKS 5 +else + define_int CONFIG_MAXLINKS 5 +fi + tristate 'Kernel automounter support' CONFIG_AUTOFS_FS | |