index  prev  next

Uppercase/Lowercase

--------------------------------------------------------------------------------------

Unix is case sensitive and SMB is case insensitive. This is perhaps the biggest problem facing developers of Unix based SMB servers. Unfortunately when you start to look at supporting multi-byte internal character sets this problem becomes much larger.

In earlier versions of Samba we needed explicit tables that told us what upper/lower case mappings exist for each character in each possible character set. In Samba 3.0 we have a single table for UCS2 and convert to/from UCS2 when we need to do case conversions. This works better, but we are still faced with the problem of asymmetric mappings and string expansion. String expansion is a diffcult (although rare) problem. There are quite a few places in Samba where we uppercase a string, like this:

     strupper(s);
Unfortunately we don't always know the storage length of the string, and the operation can change the byte length of the string.

Eventually this problem will go away because we will be using ucs2 internally, but in the meantime we need to be careful.

--------------------------------------------------------------------------------------

CIFS2001 Seattle
tridge@valinux.com