Mail Archives: djgpp-workers/2000/08/14/16:28:57
According to Laurynas Biveinis:
> This is not number of symlinks to file. This is a number of how many
> symlinks you can encounter when processing a path. (link1 -> link2 -> etc...)
> After I hit that maximum, I stop processing with ELOOP. This is probably
> the easiest and the most widespread way to detect symlink loops. Sorry for
> not being clear.
>
> > Do you even need a maximum here?
>
> Well, I don't want infinite loop in __solve_symlinks()...
> I think I will get away with simple define in xsymlink.c, if it doesn't
> matter.
Linux kernel 2.0.34 for ext2 and xiafs:
if (current->link_count > 5) {
iput (dir);
iput (inode);
return -ELOOP;
}
umsdos have same functionality implemented differently:
int ret = -ELOOP;
*res_inode = NULL;
if (current->link_count < 5) {
[Klippa, klapp, kluppit good case.]
}
iput(inode);
iput(dir);
PRINTK (("follow_link ret %d\n",ret));
return ret;
So Linux doesn't even bother with a define!
Right,
MartinS
- Raw text -