public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-apps@cygwin.com
Subject: Re: [SECURITY] libidn - locale specific error in test suite
Date: Thu, 19 Jan 2017 21:02:00 -0000	[thread overview]
Message-ID: <20170119210219.GA3775@calimero.vinschen.de> (raw)
In-Reply-To: <c6a0c136-a168-3f7b-7a6a-5ab0f3b845f2@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2281 bytes --]

On Jan 19 14:17, Eric Blake wrote:
> On 01/19/2017 12:19 PM, Corinna Vinschen wrote:
> 
> >>> The test comes from gnulib, so I'm familiar with ideas on how to try and
> >>> whittle it down to a smaller self-contained test.  I'll see if I can
> >>> spend a moment on it today.
> >>>
> >>
> >> After stepping through a debugger, it looks like this is a bug in gnulib
> >> and not cygwin.  Gnulib is trying to test that its own function
> >> gl_locale_name() can track the use of uselocale() to set a thread-local
> >> locale that overrides the global locale.  It has platform specific code
> >> for various platforms (glibc uses nl_langinfo(), BSD uses querylocale(),
> >> Sun uses getlocalename_l() - surprisingly none of the platforms use
> >> nl_langinfo_l()!), then falls back to probing the environment.  As long
> >> as cygwin lacked uselocale(), then probing the environment was correct.
> >> But now that cygwin supports uselocale(), the gnulib code needs to add a
> >> cygwin-specific clause to its list of various platform methods.
> >>
> >> I'll propose a patch to upstream gnulib, and cc this list - any project
> >> using gnulib will have to backport that patch or wait for a new upstream
> >> release of that project that uses newer gnulib if it wants to work
> >> around the bug.
> > 
> > Thanks for letting us know!
> 
> Actually, Cygwin (or newlib) will need a patch, too.  glibc provides the
> macro NL_LOCALE_NAME, which can be used as follows:
> 
> locale = newlocale(...);
> uselocale(locale);
> nl_langinfo_l(NL_LOCALE_NAME(LC_MESSAGES), locale);
> 
> to recover the name of the LC_MESSAGES portion of the locale object.
> 
> As Cygwin lacks that macro, there is NO way to access the locale name of
> what went into constructing a thread-local locale without peeking into
> the internal guts of the opaque locale_t object.

Question: Why is that needed outside of testcases?  If you called
newlocale you know how it has been constructed.  The info should be
available.  I have no problems to take glibc emulating stuff, but is
there a real-world example?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-01-19 21:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 15:18 [SECURITY] libidn Yaakov Selkowitz
2016-09-30  6:44 ` Dr. Volker Zell
2016-12-29 20:49   ` Yaakov Selkowitz
2017-01-03 10:54     ` [SECURITY] libidn - locale specific error in test suite Dr. Volker Zell
2017-01-09 14:26       ` Corinna Vinschen
2017-01-18 12:13         ` Dr. Volker Zell
2017-01-18 15:24           ` Eric Blake
2017-01-19 10:39             ` Corinna Vinschen
2017-01-19 17:40             ` Eric Blake
2017-01-19 18:19               ` Corinna Vinschen
2017-01-19 20:17                 ` Eric Blake
2017-01-19 21:02                   ` Corinna Vinschen [this message]
2017-01-19 21:17                     ` Eric Blake
2017-01-20  8:36                       ` Corinna Vinschen
2017-01-19 20:34                 ` Eric Blake
2017-01-19 20:43       ` Yaakov Selkowitz
2017-02-22 18:58         ` Yaakov Selkowitz
2017-03-10 22:01           ` Yaakov Selkowitz
2017-03-24 19:00             ` Yaakov Selkowitz
2017-05-03 21:38               ` Yaakov Selkowitz
2017-03-10 22:02           ` Yaakov Selkowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170119210219.GA3775@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).