summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-17 02:08:27 +0000
committerJeremy Allison <jra@samba.org>2004-03-17 02:08:27 +0000
commit9a86aa2c3e6687fc6480ad3f971f79cfa71442f1 (patch)
tree4035029d612cf4000466c0315dd2c5e679812001 /source3/lib
parent3e326c48c9bffa8f47f35d0444efec3e5927856e (diff)
downloadsamba-9a86aa2c3e6687fc6480ad3f971f79cfa71442f1.tar.gz
samba-9a86aa2c3e6687fc6480ad3f971f79cfa71442f1.tar.bz2
samba-9a86aa2c3e6687fc6480ad3f971f79cfa71442f1.zip
Change check_path_syntax() to use the new next_mb_char_size() function
to make it generic. Remove the mb-codepage "blacklist". Alexander, please check this fix as it reverts your blacklist changes, but I'm hoping it fixes the problem in a more generic way for all charsets. I'm not trying to trample on your (excellent!) work here, just make things more generic without special cases. Jeremy. (This used to be commit ca344a784da870965684e41c93ef8bfc5e86d28f)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charcnv.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 9ec6e73970..ad15788b84 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -41,15 +41,6 @@
static smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS];
static BOOL conv_silent; /* Should we do a debug if the conversion fails ? */
-/* Unsafe unix charsets which could contain '\\' as second byte of mb character */
-static const char *conv_unsafe_charsets[] = {
- "CP932",
- "EUC-JP",
- NULL};
-/* Global variable which is set to True in init_iconv() if unix charset is unsafe
- w.r.t. '\\' in second byte of mb character. Otherwise it is set to False.
-*/
-BOOL is_unix_charset_unsafe;
/**
* Return the name of a charset to give to iconv().
@@ -114,7 +105,6 @@ void init_iconv(void)
{
int c1, c2;
BOOL did_reload = False;
- const char **unsafe_charset = conv_unsafe_charsets;
/* so that charset_name() works we need to get the UNIX<->UCS2 going
first */
@@ -156,16 +146,6 @@ void init_iconv(void)
init_valid_table();
conv_silent = False;
}
-
- while(*unsafe_charset && strcmp(*unsafe_charset, conv_handles[CH_UCS2][CH_UNIX]->to_name)) {
- unsafe_charset++;
- }
-
- if (*unsafe_charset) {
- is_unix_charset_unsafe = True;
- } else {
- is_unix_charset_unsafe = False;
- }
}
/**
@@ -1330,6 +1310,10 @@ size_t next_mb_char_size(const char *s)
for ( i = 1; i <=4; i++ ) {
smb_ucs2_t uc;
if (convert_string(CH_UNIX, CH_UCS2, s, i, &uc, 2, False) == 2) {
+#if 0 /* JRATEST */
+ DEBUG(10,("next_mb_char_size: size %u at string %s\n",
+ (unsigned int)i, s));
+#endif
return i;
}
}