Challenges in merging the charcnv code

James Peach jorgar at gmail.com
Wed Mar 25 16:55:34 GMT 2009


2009/3/24 Andrew Bartlett <abartlet at samba.org>:
> I've hit a rather nasty challenge while trying to merge the charcnv code
> between Samba3 and Samba4.
>
> The fundamental problem starts with this:
>
>     if (allow_badcharcnv) {
>                /* Not implemented yet */
>                return false;
>     }
>
> In Samba3, many of the pull_ and push_ string functions set this flag,
> and expect to map invalid character sequences to an _
>
> In Samba4, these functions do not.   Now what behaviour should I
> implement, and indeed should this be a property of the character set
> conversions at all?
>
> The Samba3 approach (almost any character set conversion can accept bad
> input) is over-broad:  Should an attempt to upload a file with the name
> in the wrong character set succeed, but with a munged destination name?
> Should protocol strings, usernames and passwords be munged?

Another issue you might consider is that conversions for file paths
are different from general purpose conversions, eg. on OS X, we
convert file paths using HFS canonical decomposition rules, but we
don't do this for usernames and other arbitrary strings.

-- 
James Peach | jorgar at gmail.com


More information about the samba-technical mailing list