Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 15 Aug 2017 10:28:16 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: fnmatch bug? escaping of '-' and ']' inside [...] does
 not work.

On Tue, Aug 15, 2017 at 03:12:17PM +0200, Denys Vlasenko wrote:
> Moving bbox build to musl did uncover one definite bug.
> bbox has gazillion tests for its shells, and one of them
> started failing. I added debug printout and with it,
> the following fnmatch calls give different results now:
> 
> ash: fnmatch(pattern:'[a\-c]',str:'-',0):1
> ash: fnmatch(pattern:'[\]]',str:']',0):1
> ash: fnmatch(pattern:'[a\]]',str:']',0):1
> 
> glibc and uclibc threat the above as a match.

I believe this is connected to a known discrepancy between what the
standard seems to say and what glibc is doing. I'll see if I can dig
up past discussions of it. If it's coming up again, it's likely that
this is an issue that needs a proper interpretation (and possibly fix
in the language of the standard, if the current text really does imply
something different than what it's supposed to; the fix might end up
being along the lines of "it's unspecified whether...").

Rich

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.