Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 05 Jun 2015 10:58:10 +0200
From: Christian Neukirchen <chneukirchen@...il.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: Revisiting byte-based C locale

Rich Felker <dalias@...c.org> writes:

> On Thu, Jun 04, 2015 at 11:00:10PM +0200, Christian Neukirchen wrote:
>> Rich Felker <dalias@...c.org> writes:
>> 
>> > On Thu, May 21, 2015 at 10:22:03PM -0400, Rich Felker wrote:
>> >> Any new opinions on the topic? Or interest in re-emphasizing a
>> >> previously stated opinion? :)
>> >
>> > No new opinions on this? I've tentatively added drafting a new
>> > proposed byte-based C locale patch as a roadmap item for this release
>> > cycle, not necessarily to commit it, but as a way to re-evaluate
>> > whether it's still costly to implement.
>> 
>> Will it support regexec on 8-bit binary data?
>
> Yes, as long as the program has done one of the following:
>
> - Not called setlocale at all.
> - Called setlocale with an explicit "C" argument or in environment.
> - Called uselocale with a locale_t for "C".

AFAICS it does:

in main:
        (void)setlocale(LC_CTYPE, "");

protected int
file_regcomp(file_regex_t *rx, const char *pat, int flags)
{
#ifdef USE_C_LOCALE
        rx->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
        assert(rx->c_lc_ctype != NULL);
        rx->old_lc_ctype = uselocale(rx->c_lc_ctype);
        assert(rx->old_lc_ctype != NULL);
#endif
        rx->pat = pat;

        return rx->rc = regcomp(&rx->rx, pat, flags);
}


>> We found out file(1)
>> needs this.
>
> Indeed, aside from the Austin Group issue 663, having this topic come
> up several times in real-world usage is the motivation for
> reconsidering it. I believe file(1) _attempts_ to do this right,
> making use of uselocale.

A strong +1 from me then.  I'll be glad to help testing it on Void Linux.

-- 
Christian Neukirchen  <chneukirchen@...il.com>  http://chneukirchen.org

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.