remaining tdb changes to merge

tridge at samba.org tridge at samba.org
Fri Oct 20 10:09:14 GMT 2006


I've just merged most of the differences between SAMBA_3_0 and
SAMBA_4_0

The remaining differences are:

 - samba3 uses 'char *' in TDB_DATA, samba4 uses 'unsigned char *'

 - samba3 splits out the struct tdb_transaction_el structure from the
   main transaction struct to make it C++ compatible

 - samba3 has extensive changes to tdbutil.c

 - samba3 has extensive changes to tdbbackup, tdbdump and
   tdbtool. 

On the first difference (char * versus unsigned char *), I'd like to
change Samba3 to use 'unsigned char *' for that structure, but want to
get opinions first. The justification for the change is that the bytes
in 'char *' behave differently on different platforms. So when a
programmer is extracting binary data from a tdb, and declares a char *
to match the extracted data, then the resulting code can behave
differently depending on whether that platform has signed or unsigned
characters. This is fine if the tdb is really being used for strings,
but can lead to platform specific bugs if not.

On the second difference, I'd like to check with Volker and Jeremy as
to whether you are still aiming for that particular aspect of C++
compatibility in Samba3. 

On the 3rd difference (the tdbutil.c changes) isn't really suitable
for merging. It uses lots of stuff that is fairly specific to
Samba3. I think we should really move tdb/tdbutil.c into lib/util_tdb.c
in Samba3, and get rid of it completely in Samba4. When tdbutil.c was
first written it needed to be part of tdb as it looked inside the tdb
private structures, but I have now removed the last of the
dependencies on the internals of tdb, and now tdbutil.c is just a
normal Samba3 source file, using includes.h and nothing extra. It was
never intended to be part of the public tdb API, as it could only ever
build as part of Samba, so I don't think it should live in the tdb/
directory.

The final difference (the tools) needs some more merging work. There
are some Samba3 specific bits in there (like pstring.h) that I think
should be removed if these tools are to be kept as part of the core of
tdb.

Cheers, Tridge



More information about the samba-technical mailing list