It is possible to make a nice LGPLd shared object library for people to link to in order to access Samba's TDB files. Only TDB.H, TDB.C SPINLOCK.C and SPINLOCK.H are needed from the Samba sources (built -D StandAlone). All of these files except SPINLOCK.H has an LGPL header. Please put an LGPL header in SPINLOCK.H as well.
Spinlocks have been removed from the tree, so I guess this doesn't apply any more.