Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 60199 invoked from network); 5 Sep 2008 04:31:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 04:31:17 -0000 Received: (qmail 86156 invoked by uid 500); 5 Sep 2008 04:31:14 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 86116 invoked by uid 500); 5 Sep 2008 04:31:14 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 86105 invoked by uid 99); 5 Sep 2008 04:31:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 21:31:14 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [88.84.142.181] (HELO samaflost.de) (88.84.142.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 04:30:16 +0000 Received: from localhost (unknown [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id 6AF2CE220014 for ; Fri, 5 Sep 2008 04:30:16 +0000 (UTC) Received: from samaflost.de ([127.0.0.1]) by localhost (v30161.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01936-04 for ; Fri, 5 Sep 2008 06:30:12 +0200 (CEST) Received: by samaflost.de (Postfix, from userid 2525) id ED4DAE22000A; Fri, 5 Sep 2008 06:30:11 +0200 (CEST) To: dev@ant.apache.org Subject: Re: DirectoryScanner and Symlinks X-Draft-From: ("nnfolder:mail.jakarta-ant" 89052) References: <439330.18251.qm@web55104.mail.re4.yahoo.com> From: Stefan Bodewig Date: Fri, 05 Sep 2008 06:30:11 +0200 In-Reply-To: <439330.18251.qm@web55104.mail.re4.yahoo.com> (Matt Benson's message of "Thu\, 4 Sep 2008 08\:29\:50 -0700 \(PDT\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: amavisd-new at samaflost.de X-Virus-Checked: Checked by ClamAV on apache.org On Thu, 4 Sep 2008, Matt Benson wrote: > In a nutshell, it seems we should keep track of the > canonical paths scanned and refuse to recurse them for > a path of infinite depth (i.e. one containing "**"). The situation of the testcase is (you'll need a monospaced font 8-) ,------>I | / \ | / \ | base B | / \ | / \ `--A file.txt the fileset's basedir is "base". > It could be possible to match a path containing a > recursive symlink by > 1 path of different lengths. > So the infinite depth case is the one that could cause > infinite recursion and is thus the one that should be > guarded... You mean an explicit A/base/A/B/file.txt would match but the same file wouldn't be included if I used A/base/A/B/** or A/base/A/** ? I could live with that, but it may seem confusing. Not that I'd expect anybody to use these kinds of patterns. Would **/file.txt match A/B/file.txt at all? > this shouldn't break anything that was already working, True. Most ** cases would run into infinite loops or fail with an exception caused by the OS (Linux seems to limit the recursion depths in a similar way Dominique suggests). In my example above A/base/A/B/** wouldn't cause an infinite loop, so the logic of not following a symlink must only be triggered if the symlink itself would be part of the ** part. In the end Dominique's idea may be simpler since we'd have to think through cases of multiple patterns where one mathes exactly and the other one is inside the ** part. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org