delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/14/16:28:57

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200008142028.WAA25681@father.ludd.luth.se>
Subject: Re: <limits.h> change for symlinks
In-Reply-To: <39983839.E5692C3D@softhome.net> from Laurynas Biveinis at "Aug 14, 2000 08:19:37 pm"
To: djgpp-workers AT delorie DOT com
Date: Mon, 14 Aug 2000 22:28:42 +0200 (MET DST)
X-Mailer: ELM [version 2.4ME+ PL54 (25)]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019