summaryrefslogtreecommitdiff
path: root/lib/util/charset
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-18 11:51:37 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-05-18 16:12:08 +0200
commit3c8de7dd66390c00542118ec3aaa84e1e20956cb (patch)
tree4ec9b88a8d61961bddf2d12d14e032caf0f54d01 /lib/util/charset
parent035dbce3adcbf36afee5e9cc59912c4f07fe0f5e (diff)
downloadsamba-3c8de7dd66390c00542118ec3aaa84e1e20956cb.tar.gz
samba-3c8de7dd66390c00542118ec3aaa84e1e20956cb.tar.bz2
samba-3c8de7dd66390c00542118ec3aaa84e1e20956cb.zip
lib/util/charset Don't allow invalid 'dos charset = utf8'
No DOS client used UTF8, and this creates subtle, difficult to disagnose breakage of schannel (domain membership). Andrew Bartlett
Diffstat (limited to 'lib/util/charset')
-rw-r--r--lib/util/charset/codepoints.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c
index 5e8ac64ed4..71611bfc4c 100644
--- a/lib/util/charset/codepoints.c
+++ b/lib/util/charset/codepoints.c
@@ -290,6 +290,11 @@ _PUBLIC_ struct smb_iconv_handle *smb_iconv_handle_reinit(TALLOC_CTX *mem_ctx,
talloc_set_destructor(ret, close_iconv_handle);
+ if (strcasecmp(dos_charset, "UTF8") == 0 || strcasecmp(dos_charset, "UTF-8") == 0) {
+ DEBUG(0,("ERROR: invalid DOS charset: 'dos charset' must not be UTF8, using (default value) CP850 instead\n"));
+ dos_charset = "CP850";
+ }
+
ret->dos_charset = talloc_strdup(ret->child_ctx, dos_charset);
ret->unix_charset = talloc_strdup(ret->child_ctx, unix_charset);
ret->display_charset = talloc_strdup(ret->child_ctx, display_charset);