Challenges in merging the charcnv code

Andrew Bartlett abartlet at samba.org
Wed Mar 25 19:50:13 GMT 2009


On Wed, 2009-03-25 at 09:21 -0700, Jeremy Allison wrote:
> On Wed, Mar 25, 2009 at 02:20:12PM +1100, Andrew Bartlett wrote:
> > 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?  
> 
> Yes, sorry. Please keep existing behavior, changing this will
> cause problems for existing deployments. Don't check in code
> changes that do this please.
> 
> > This is why I wonder if perhaps it should instead be a pre-filter in the
> > cases where we actually need this?  Perhaps by the time we release what
> > comes after Samba 3.4 we can expect that servers will correctly report
> > the character set of the data they hold?
> 
> Nope. That will never happen. People don't always know.
> 
> > Whatever happens, I don't want to end up with a solution where we have
> > 'if in Samba3' checks in the core character set routines. 
> > 
> > Could we at least agree to always munge to 0xFFFD?
> 
> No, sorry. That's not compatible with existing behavior. It will
> break existing deployments. Now you could argue that they're already
> broken, and we should log every time when we're forced to do this
> to get people to fix it, but no changes here please.

Based on the above I no longer propose for merging the full patch stream
to use the common charcnv engine.  I present for the consideration of
the Samba3 team a rebased patch series to remove the _allocate() charset
APIs and some other small changes to make it easier for someone else to
take this task on at some future time:  

http://gitweb.samba.org/?p=abartlet/samba.git/.git;a=shortlog;h=refs/heads/charcnv-minimal-merge

I understand Volker is interested in reworking this series to use
talloc_tos(), so perhaps he can merge the final product.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20090326/a79c33fa/attachment.bin


More information about the samba-technical mailing list