From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: trivial DoS on char recoding |
Date: | 2006-06-21 06:43:56 |
Message-ID: | 20060621064356.GA6149@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Jun 20, 2006 at 06:10:38PM -0400, Tom Lane wrote:
> > Should we get firmer in rejecting invalid configurations?
>
> The question is how sure are we whether a configuration is "invalid".
> AFAIK there's not a really portable way to determine which encoding
> matches a locale. initdb has a kluge that seems to work most of the
> time, but do we want the database to refuse to start when it doesn't?
Well, this "kludge" is the recommended and documented way to do it on
glibc based systems as well as many others.
It turns out however that there is a libcharset[1] for portably
determining the charset for your current locale. What's most
interesting about it is that it has tables for various OSes and
mappings from their names to standard names (the ones used by Glibc).
It's LGPL so we can't include the stuff verbatim, but it's not a lot of
code.
I'm not sure why we persist in beleiving this test is so unreliable we
won't even emit a warning...
[1] http://www.haible.de/bruno/packages-libcharset.html
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | John Jawed | 2006-06-21 07:32:08 | [ppa][PATCHES] Argument handling improvements |
Previous Message | Qingqing Zhou | 2006-06-21 02:20:08 | Re: shall we have a TRACE_MEMORY mode |