Managing DNs in libads only in utf8

simo idra at samba.org
Tue Feb 27 13:54:29 GMT 2007


On Tue, 2007-02-27 at 14:50 +0100, Volker Lendecke wrote:
> On Tue, Feb 27, 2007 at 08:29:33AM -0500, simo wrote:
> > > So before you go down this route I'd like
> > > a good example of what will unexpectedly
> > > fail vs. the complexity of internally "remembering"
> > > some strings are now natively utf8 internally
> > > rather than "unix charset". Remember you need
> > > to track this and convert across all boundaries.
> > 
> > I know, if you care the read the mail, you will se I did that, and
> > checked each and every usage, and made sure nothing leaks this way.
> 
> I would feel a lot better if this change would be done with
> compile-time checking by going the 'struct utf8_string' way.
> We did not have for example effective WERROR vs NTSTATUS
> checks, both had ".v" as structure member, and it inevitably
> happened over time that errors crept in. If we clearly mark
> a string as utf8, indicating this to the compiler, then this
> kind of error can not happen. Without this I would be *very*
> sceptical.

I proposed "#define smb_utf8_t char" in another mail, but I like your
proposal as well, even more.
If everybody agrees I will proceed in converting the code to use
something like:
#typedef struct { char * dn } smb_utf8_dn;

This should make it really hard to leak any utf8 string by mistake, and
should keep everybody happy the boundary is very well defined.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list