diff options
author | Jeremy Allison <jra@samba.org> | 2005-12-27 20:52:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:58 -0500 |
commit | 5a4881bf396e691524329bcd6aa1ae4a7f4084ec (patch) | |
tree | ea2cce14847e28629ec48f2a70f547bdbb08fe98 /source3/smbd | |
parent | d186ff50721011f839a02aaac4866201eda23034 (diff) | |
download | samba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.tar.gz samba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.tar.bz2 samba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.zip |
r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")
and replace calls to isupper/islower/toupper/tolower with
ASCII equivalents (mapping into _w variants).
Jeremy.
(This used to be commit c2752347eb2deeb2798c580ec7fc751a847717e9)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/mangle_hash.c | 6 | ||||
-rw-r--r-- | source3/smbd/mangle_hash2.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c index 30befd2c84..2092f430c0 100644 --- a/source3/smbd/mangle_hash.c +++ b/source3/smbd/mangle_hash.c @@ -372,8 +372,8 @@ static BOOL is_mangled(const char *s, int snum) magic = strchr_m( s, magic_char ); while( magic && magic[1] && magic[2] ) { /* 3 chars, 1st is magic. */ if( ('.' == magic[3] || '/' == magic[3] || !(magic[3])) /* Ends with '.' or nul or '/' ? */ - && isbasechar( toupper(magic[1]) ) /* is 2nd char basechar? */ - && isbasechar( toupper(magic[2]) ) ) /* is 3rd char basechar? */ + && isbasechar( toupper_ascii(magic[1]) ) /* is 2nd char basechar? */ + && isbasechar( toupper_ascii(magic[2]) ) ) /* is 3rd char basechar? */ return( True ); /* If all above, then true, */ magic = strchr_m( magic+1, magic_char ); /* else seek next magic. */ } @@ -426,7 +426,7 @@ static void cache_mangled_name( const char mangled_name[13], char *raw_name ) s1 = strrchr( mangled_name_key, '.' ); if( s1 && (s2 = strrchr( raw_name, '.' )) ) { size_t i = 1; - while( s1[i] && (tolower( s1[i] ) == s2[i]) ) + while( s1[i] && (tolower_ascii( s1[i] ) == s2[i]) ) i++; if( !s1[i] && !s2[i] ) { /* Truncate at the '.' */ diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index 335ba8e2ef..0a161c9e76 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -560,7 +560,7 @@ static void name_map(fstring name, BOOL need83, BOOL cache83, int default_case, if (! FLAG_CHECK(lead_chars[i], FLAG_ASCII)) { lead_chars[i] = '_'; } - lead_chars[i] = toupper(lead_chars[i]); + lead_chars[i] = toupper_ascii(lead_chars[i]); } for (;i<mangle_prefix;i++) { lead_chars[i] = '_'; @@ -580,7 +580,7 @@ static void name_map(fstring name, BOOL need83, BOOL cache83, int default_case, for (i=1; extension_length < 3 && dot_p[i]; i++) { char c = dot_p[i]; if (FLAG_CHECK(c, FLAG_ASCII)) { - extension[extension_length++] = toupper(c); + extension[extension_length++] = toupper_ascii(c); } } } @@ -679,10 +679,10 @@ static void init_tables(void) char_flags[c2] |= FLAG_POSSIBLE2; char_flags[c3] |= FLAG_POSSIBLE3; char_flags[c4] |= FLAG_POSSIBLE4; - char_flags[tolower(c1)] |= FLAG_POSSIBLE1; - char_flags[tolower(c2)] |= FLAG_POSSIBLE2; - char_flags[tolower(c3)] |= FLAG_POSSIBLE3; - char_flags[tolower(c4)] |= FLAG_POSSIBLE4; + char_flags[tolower_ascii(c1)] |= FLAG_POSSIBLE1; + char_flags[tolower_ascii(c2)] |= FLAG_POSSIBLE2; + char_flags[tolower_ascii(c3)] |= FLAG_POSSIBLE3; + char_flags[tolower_ascii(c4)] |= FLAG_POSSIBLE4; char_flags[(unsigned char)'.'] |= FLAG_POSSIBLE4; } |