diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-22 09:58:59 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-23 13:47:27 +0200 |
commit | de0e0119447060c64f4531c031e5509de3afc1b5 (patch) | |
tree | 777432b63b90070d4afddfeff5148ff7ffca36f5 /lib/util/charset | |
parent | 125a2ff262aa312df20eec68802fd5f8a47f492f (diff) | |
download | samba-de0e0119447060c64f4531c031e5509de3afc1b5.tar.gz samba-de0e0119447060c64f4531c031e5509de3afc1b5.tar.bz2 samba-de0e0119447060c64f4531c031e5509de3afc1b5.zip |
lib/util/charset: Remove autodetection of charset from LOCALE
In the past, our LOCALE would set the display charset of Samba. The
display charset has now been removed. This patch removes the support
code that detected the locale from the environment. We cannot safely
have 'unix charset' follow the locale (at it creates files on disk and
entries in databases that must not vary), so this code is unused.
As an example, imagine a database is manipulated in the
administrator's locale, and then read by smbd starting up in the
system default locale. Or smbd restarted by the administrator rather
than a startup script. Both of these situations could corrupt
databases or filenames on disk.
Andrew Bartlett
Diffstat (limited to 'lib/util/charset')
-rw-r--r-- | lib/util/charset/codepoints.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c index 305bfd717f..8cc33a9782 100644 --- a/lib/util/charset/codepoints.c +++ b/lib/util/charset/codepoints.c @@ -217,37 +217,6 @@ static int close_iconv_handle(struct smb_iconv_handle *data) return 0; } -static const char *map_locale(const char *charset) -{ - if (strcmp(charset, "LOCALE") != 0) { - return charset; - } -#if defined(HAVE_NL_LANGINFO) && defined(CODESET) - { - const char *ln; - smb_iconv_t handle; - - ln = nl_langinfo(CODESET); - if (ln == NULL) { - DEBUG(1,("Unable to determine charset for LOCALE - using ASCII\n")); - return "ASCII"; - } - /* Check whether the charset name is supported - by iconv */ - handle = smb_iconv_open(ln, "UCS-2LE"); - if (handle == (smb_iconv_t) -1) { - DEBUG(5,("Locale charset '%s' unsupported, using ASCII instead\n", ln)); - return "ASCII"; - } else { - DEBUG(5,("Substituting charset '%s' for LOCALE\n", ln)); - smb_iconv_close(handle); - } - return ln; - } -#endif - return "ASCII"; -} - /* the old_ic is passed in here as the smb_iconv_handle structure is used as a global pointer in some places (eg. python modules). We |