This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/1][BZ #866] glob() should match dangling symlinks.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org, glibc at tomlee dot co
- Date: Fri, 3 Jan 2014 10:26:38 +0100
- Subject: Re: [PATCH 2/1][BZ #866] glob() should match dangling symlinks.
- Authentication-results: sourceware.org; auth=none
- References: <20131003075937 dot GA22576 at domone dot podge> <201401021704 dot 30170 dot vapier at gentoo dot org> <20140102233948 dot GA5026 at domone> <201401022123 dot 47077 dot vapier at gentoo dot org>
On Thu, Jan 02, 2014 at 09:23:46PM -0500, Mike Frysinger wrote:
> On Thursday 02 January 2014 18:39:48 OndÅej BÃlka wrote:
> > On Thu, Jan 02, 2014 at 05:04:29PM -0500, Mike Frysinger wrote:
> > > On Saturday 12 October 2013 04:25:29 OndÅej BÃlka wrote:
> > > > status = glob_in_dir (filename, dirs.gl_pathv[i],
> > > > ((flags | GLOB_APPEND)
> > > > & ~(GLOB_NOCHECK | GLOB_NOMAGIC)),
> > > > - errfunc, pglob, alloca_used);
> > > > + errfunc, pglob, alloca_used, 1);
> > >
> > > what is this scenario where we're still checking the links ?
> >
> > Rationale was not match dangling symlinks when matching directories like
> > glob ("*/", ...)
> >
> > I do not remember exact logic now, glob code takes quite bit of effort
> > to track what happens there.
>
> we need testcases that enforce either behavior. i'm not quite seeing what
> you're hinting at.
>
A testcase is here:
https://www.sourceware.org/ml/libc-alpha/2013-12/msg00165.html
> $ mkdir d
> $ cd d
> $ ln -s a/ b
>
> so you want a glob of */ to not match a/ ?
>
> or b/ exists and inside of that there are dangling symlinks ?
> -mike
That should not be matched, I tried to dig into history for exact
reason, check was added in 66b38fc99ecc3835502fae6851908b0d11d6b175
but I did not find a mail thread for that commit.