#include "dsdb/samdb/samdb.h"
#include "param/param.h"
#include "../lib/util/dlinklist.h"
-#include "../lib/tdb_compat/tdb_compat.h"
+#include <tdb.h>
/*
this is used to catch debug messages from ldb
/*
when we fork() we need to make sure that any open ldb contexts have
- any open transactions cancelled
+ any open transactions cancelled (ntdb databases doesn't need reopening,
+ as we don't use clear_if_first).
*/
void ldb_wrap_fork_hook(void)
{
source='ldif_handlers.c',
autoproto='ldif_handlers_proto.h',
public_deps='ldb',
- deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb_compat pyldb-util errors',
+ deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb pyldb-util errors',
private_library=True
)
key.dptr = discard_const_p(unsigned char, ldb_dn_get_linearized(dn));
key.dsize = strlen((char *)key.dptr);
- rec = tdb_fetch_compat(ltdb->idxptr->itdb, key);
+ rec = tdb_fetch(ltdb->idxptr->itdb, key);
if (rec.dptr == NULL) {
goto normal_index;
}
}
if (ltdb->idxptr->itdb == NULL) {
- ltdb->idxptr->itdb = tdb_open_compat(NULL, 1000, TDB_INTERNAL, O_RDWR, 0, NULL, NULL);
+ ltdb->idxptr->itdb = tdb_open(NULL, 1000, TDB_INTERNAL, O_RDWR, 0);
if (ltdb->idxptr->itdb == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
key.dptr = discard_const_p(unsigned char, ldb_dn_get_linearized(dn));
key.dsize = strlen((char *)key.dptr);
- rec = tdb_fetch_compat(ltdb->idxptr->itdb, key);
+ rec = tdb_fetch(ltdb->idxptr->itdb, key);
if (rec.dptr != NULL) {
list2 = ltdb_index_idxptr(module, rec, false);
if (list2 == NULL) {
*/
#include "ldb_tdb.h"
-#include <lib/tdb_compat/tdb_compat.h>
+#include <tdb.h>
/*
add one element to a message
return LDB_ERR_OPERATIONS_ERROR;
}
- tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
talloc_free(tdb_key.dptr);
if (!tdb_data.dptr) {
return LDB_ERR_NO_SUCH_OBJECT;
return LDB_ERR_OPERATIONS_ERROR;
}
- tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
talloc_free(tdb_key.dptr);
if (!tdb_data.dptr) {
return LDB_ERR_NO_SUCH_OBJECT;
*/
#include "ldb_tdb.h"
-#include <lib/tdb_compat/tdb_compat.h>
+#include <tdb.h>
/*
prevent memory errors on callbacks
return LDB_ERR_OTHER;
}
- tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
if (!tdb_data.dptr) {
talloc_free(tdb_key.dptr);
return ltdb_err_map(tdb_error(ltdb->tdb));
#include "replace.h"
#include "system/filesys.h"
#include "system/time.h"
-#include "tdb_compat.h"
+#include "tdb.h"
#include "ldb_module.h"
/* this private structure is used by the ltdb backend in the
struct ldb_context *ldb)
{
struct ltdb_wrap *w;
+ struct tdb_logging_context lctx;
struct stat st;
if (stat(path, &st) == 0) {
return NULL;
}
- w->tdb = tdb_open_compat(path, hash_size, tdb_flags, open_flags, mode, ltdb_log_fn, ldb);
+ lctx.log_fn = ltdb_log_fn;
+ lctx.log_private = ldb;
+ w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode,
+ &lctx, NULL);
if (w->tdb == NULL) {
talloc_free(w);
return NULL;
import wafsamba, samba_dist, Options
samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
- lib/tdb:lib/tdb lib/tdb2:lib/tdb2 lib/tdb_compat:lib/tdb_compat lib/ccan:lib/ccan lib/tevent:lib/tevent lib/popt:lib/popt
+ lib/tdb:lib/tdb lib/tdb2:lib/tdb2 lib/tdb:lib/tdb lib/ccan:lib/ccan lib/tevent:lib/tevent lib/popt:lib/popt
buildtools:buildtools''')
def set_options(opt):
opt.BUILTIN_DEFAULT('replace')
opt.PRIVATE_EXTENSION_DEFAULT('ldb', noextension='ldb')
- opt.RECURSE('lib/tdb_compat')
+ opt.RECURSE('lib/tdb')
opt.RECURSE('lib/tevent')
opt.RECURSE('lib/replace')
opt.tool_options('python') # options for disabling pyc or pyo compilation
def configure(conf):
- conf.RECURSE('lib/tdb_compat')
+ conf.RECURSE('lib/tdb')
conf.RECURSE('lib/tevent')
conf.RECURSE('lib/popt')
conf.RECURSE('lib/replace')
- conf.RECURSE('lib/tdb_compat')
conf.find_program('python', var='PYTHON')
conf.find_program('xsltproc', var='XSLTPROC')
conf.check_tool('python')
conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
def build(bld):
- bld.RECURSE('lib/tdb_compat')
bld.RECURSE('lib/tevent')
bld.RECURSE('lib/popt')
bld.RECURSE('lib/replace')
- bld.RECURSE('lib/tdb_compat')
+ bld.RECURSE('lib/tdb')
if bld.env.standalone_ldb:
private_library = False
init_function='ldb_tdb_init',
module_init_name='ldb_init_module',
internal_module=False,
- deps='tdb_compat ldb',
+ deps='tdb ldb',
subsystem='ldb')
# have a separate subsystem for common/ldb.c, so it can rebuild
# for install with a different -DLDB_MODULESDIR=
bld.SAMBA_SUBSYSTEM('LIBLDB_MAIN',
'common/ldb.c',
- deps='tevent tdb_compat',
+ deps='tevent tdb',
includes='include',
cflags=['-DLDB_MODULESDIR=\"%s\"' % modules_dir])
tdb_key.dptr = (uint8_t *)discard_const_p(char, key);
tdb_key.dsize = strlen(key);
- tdb_data = tdb_fetch_compat(tdb, tdb_key);
+ tdb_data = tdb_fetch(tdb, tdb_key);
if (!tdb_data.dptr) {
if (tdb_error(tdb) == TDB_ERR_NOEXIST) {
*value = default_value;
return LDB_SUCCESS;
} else {
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr_compat(tdb));
+ tdb_errorstr(tdb));
}
}
if (tdb_store(tdb, tdb_key, tdb_data, tdb_flag) != 0) {
talloc_free(tmp_ctx);
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr_compat(tdb));
+ tdb_errorstr(tdb));
}
talloc_free(tmp_ctx);
if (tdb_transaction_start(tdb) != 0) {
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr_compat(tdb));
+ tdb_errorstr(tdb));
}
data->metadata->in_transaction++;
if (tdb_transaction_prepare_commit(tdb) != 0) {
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr_compat(tdb));
+ tdb_errorstr(tdb));
}
return LDB_SUCCESS;
if (tdb_transaction_commit(tdb) != 0) {
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr_compat(tdb));
+ tdb_errorstr(tdb));
}
return LDB_SUCCESS;