bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib/glibc bug in fnmatch()


From: Eric Blake
Subject: Re: gnulib/glibc bug in fnmatch()
Date: Tue, 25 Jan 2011 22:15:45 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/08/2011 03:34 PM, Eric Blake wrote:
> I just filed: http://sourceware.org/bugzilla/show_bug.cgi?id=12378
> 
> which is in turn the root cause of this findutils bug:
> https://savannah.gnu.org/bugs/index.php?32043
> 
> Basically, fnmatch("[","[",0) is required by POSIX 2008 to return 0, but
> in glibc, it returns FNM_NOMATCH.
> 
> (It's behavior was more or less undefined in POSIX 2001, because it
> represented an unterminated bracket expression which is thus an invalid
> glob; but POSIX 2008 tightened the definition of globs to require that a
> leading bracket that does not introduce a bracket expression must match
> itself, in light of the fact that the [ utility (aka test) is an example
> of a file name that looks like an unterminated bracket expression but
> does not trigger globbing.)
> 
> I'm not sure how simple the fix will be, or how fast it will be patched
> in glibc, but since gnulib copies the glibc definition, we'll need to
> fix the gnulib implementation of fnmatch.

Glibc 2.13 has now fixed the bug, but gnulib and glibc have diverged a
while ago, so it's a bit of a project to backport all the changes
(including this particular fix).  I'm not sure when I'll get around to
it, and welcome anyone else doing the sync first.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]