{
struct db_context *db = NULL;
- db = db_open_tdb(mem_ctx, lp_ctx, name, hash_size,
- tdb_flags, open_flags, mode,
+ if (hash_size == 0) {
+ hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
+ }
+
+ db = db_open_tdb(mem_ctx, name, hash_size,
+ lpcfg_tdb_flags(lp_ctx, tdb_flags),
+ open_flags, mode,
lock_order, dbwrap_flags);
return db;
}
struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
}
result->lock_order = lock_order;
- if (hash_size == 0) {
- hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
- }
-
- db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size,
- lpcfg_tdb_flags(lp_ctx, tdb_flags),
+ db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, tdb_flags,
open_flags, mode);
if (db_tdb->wtdb == NULL) {
DEBUG(3, ("Could not open tdb: %s\n", strerror(errno)));
struct db_context;
struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
int blobsize;
int ret;
TALLOC_CTX *mem_ctx;
+ struct loadparm_context *lp_ctx;
struct db_context *eadb = NULL;
struct file_id id;
struct stat sbuf;
blob.length = blobsize;
mem_ctx = talloc_new(NULL);
- eadb = db_open_tdb(mem_ctx, py_default_loadparm_context(mem_ctx), tdbname, 50000,
- TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
+
+ lp_ctx = py_default_loadparm_context(mem_ctx);
+ eadb = db_open_tdb(mem_ctx, tdbname, 50000,
+ lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT),
+ O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
DBWRAP_FLAG_NONE);
if (eadb == NULL) {
{
char *filename, *attribute, *tdbname;
TALLOC_CTX *mem_ctx;
+ struct loadparm_context *lp_ctx;
DATA_BLOB blob;
PyObject *ret_obj;
int ret;
mem_ctx = talloc_new(NULL);
- eadb = db_open_tdb(mem_ctx, py_default_loadparm_context(mem_ctx), tdbname, 50000,
- TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
+ lp_ctx = py_default_loadparm_context(mem_ctx);
+ eadb = db_open_tdb(mem_ctx, tdbname, 50000,
+ lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT),
+ O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
DBWRAP_FLAG_NONE);
if (eadb == NULL) {