Re: DirectoryScanner and Symlinks

2008-09-10 Thread Dominique Devienne
On Wed, Sep 10, 2008 at 2:58 PM, Gilles Scokart <[EMAIL PROTECTED]> wrote: > If I take the example, > I <-\ > / \ | >/ \ | > B C| > / \ | > / \ | > file.txt A--/ > > and I start with /, with the pattern /**/*.txt,

Re: DirectoryScanner and Symlinks

2008-09-10 Thread Gilles Scokart
2008/9/10 Stefan Bodewig <[EMAIL PROTECTED]>: > On Mon, 8 Sep 2008, Dominique Devienne <[EMAIL PROTECTED]> wrote: > >> On Mon, Sep 8, 2008 at 5:01 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: >> > Does that sound OK? >> >> Sounds good to me. > > Of course we'd first check when we hit the name for

Re: DirectoryScanner and Symlinks

2008-09-10 Thread Stefan Bodewig
On Wed, 10 Sep 2008, Dominique Devienne <[EMAIL PROTECTED]> wrote: > On Wed, Sep 10, 2008 at 3:20 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > >> Similarly, maybe an internal flag in DS should be gettable to > >> possibly have client code remove duplicate entries if it wants to??? > > > > Not s

Re: DirectoryScanner and Symlinks

2008-09-10 Thread Stefan Bodewig
Code is in, documentation is not. Please help me find good names and default values 8-) On Mon, 08 Sep 2008, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > OK, combining suggestions by Gilles and Dominique here is what we > could do: > > * add a new sttribute for maxSymlinkRecursionDepth (better n

Re: DirectoryScanner and Symlinks

2008-09-10 Thread Dominique Devienne
On Wed, Sep 10, 2008 at 3:20 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: >> Similarly, maybe an internal flag in DS should be gettable to >> possibly have client code remove duplicate entries if it wants to??? > > Not sure what you mean here. Have an new accessor on DirectoryScanner to find out

Re: DirectoryScanner and Symlinks

2008-09-10 Thread Stefan Bodewig
On Mon, 8 Sep 2008, Dominique Devienne <[EMAIL PROTECTED]> wrote: > On Mon, Sep 8, 2008 at 5:01 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > > Does that sound OK? > > Sounds good to me. Of course we'd first check when we hit the name for the (MAX + 1)th time not for the MAXth time since the f

Re: DirectoryScanner and Symlinks

2008-09-08 Thread Dominique Devienne
On Mon, Sep 8, 2008 at 5:01 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > Does that sound OK? Sounds good to me. I'd simply add a warning indicating maxSymlinkTraversal was hit. "User" or verbose level is debatable again. Similarly, maybe an internal flag in DS should be gettable to possibly hav

Re: DirectoryScanner and Symlinks

2008-09-08 Thread Stefan Bodewig
On Mon, 8 Sep 2008, Gilles Scokart <[EMAIL PROTECTED]> wrote: > I fear that with this aproach, you may have to "rollback" some of > the files already scanned because you will detect a loop after you > have already looped one or more time (including multiple time the > same files). We'd detect the

Re: DirectoryScanner and Symlinks

2008-09-08 Thread Gilles Scokart
I fear that with this aproach, you may have to "rollback" some of the files already scanned because you will detect a loop after you have already looped one or more time (including multiple time the same files). This "rollback" will be required if you want to provide a "clean" fileset when the pat

Re: DirectoryScanner and Symlinks

2008-09-08 Thread Stefan Bodewig
OK, combining suggestions by Gilles and Dominique here is what we could do: * add a new sttribute for maxSymlinkRecursionDepth (better name appreciated) and make it default to 5 (up for discussion as well). This limits how many times the same symlink can be followed. * Keep a stack of simple

Re: DirectoryScanner and Symlinks

2008-09-05 Thread Gilles Scokart
2008/9/5 Stefan Bodewig <[EMAIL PROTECTED]>: > On Fri, 5 Sep 2008, Gilles Scokart <[EMAIL PROTECTED]> wrote: > >> 2008/9/5 Stefan Bodewig <[EMAIL PROTECTED]>: >>> On Thu, 4 Sep 2008, Peter Reilly <[EMAIL PROTECTED]> wrote: >>> Is it not costly (as in very costly) to get the canonical path ? >>

Re: DirectoryScanner and Symlinks

2008-09-05 Thread Stefan Bodewig
On Fri, 5 Sep 2008, Gilles Scokart <[EMAIL PROTECTED]> wrote: > 2008/9/5 Stefan Bodewig <[EMAIL PROTECTED]>: >> On Thu, 4 Sep 2008, Peter Reilly <[EMAIL PROTECTED]> wrote: >> >>> Is it not costly (as in very costly) to get the canonical path ? >> >> That's what I've been told but I've never measur

Re: DirectoryScanner and Symlinks

2008-09-05 Thread Gilles Scokart
2008/9/5 Stefan Bodewig <[EMAIL PROTECTED]>: > On Thu, 4 Sep 2008, Peter Reilly <[EMAIL PROTECTED]> wrote: > >> Is it not costly (as in very costly) to get the canonical path ? > > That's what I've been told but I've never measured it. > > Currently DirectoryScanner avoids looking at the canonical

Re: DirectoryScanner and Symlinks

2008-09-04 Thread Stefan Bodewig
On Thu, 4 Sep 2008, Matt Benson <[EMAIL PROTECTED]> 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-)

Re: DirectoryScanner and Symlinks

2008-09-04 Thread Stefan Bodewig
On Thu, 4 Sep 2008, Peter Reilly <[EMAIL PROTECTED]> wrote: > Is it not costly (as in very costly) to get the canonical path ? That's what I've been told but I've never measured it. Currently DirectoryScanner avoids looking at the canonical path unless followSymlinks is false. The problem with

Re: DirectoryScanner and Symlinks

2008-09-04 Thread Peter Reilly
Is it not costly (as in very costly) to get the canonical path ? I would be for the lowest tech possible here. Peter On Thu, Sep 4, 2008 at 4:38 PM, Dominique Devienne <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 7:32 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: >> as Issue 45499 shows

Re: DirectoryScanner and Symlinks

2008-09-04 Thread Dominique Devienne
On Thu, Sep 4, 2008 at 7:32 AM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > as Issue 45499 shows DirectoryScanner can run into infinite loops by > symbolic links that point to parent directories of the scanned > directory. Instead of trying to track traversed directories using a stack or set, what

Re: DirectoryScanner and Symlinks

2008-09-04 Thread Matt Benson
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 "**"). 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 o