From: Martin Str|mberg Message-Id: <200008142028.WAA25681@father.ludd.luth.se> Subject: Re: 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Precedence: bulk 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