mirror of
https://github.com/samba-team/samba.git
synced 2025-01-03 01:18:10 +03:00
dbwrap: Remove calls to loadparm
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
812312ca17
commit
1aeac2f85d
@ -250,7 +250,6 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
|
|||||||
|
|
||||||
db_ctx = dbwrap_local_open(
|
db_ctx = dbwrap_local_open(
|
||||||
cred,
|
cred,
|
||||||
lp_ctx,
|
|
||||||
secrets_tdb_path,
|
secrets_tdb_path,
|
||||||
hash_size,
|
hash_size,
|
||||||
tdb_flags,
|
tdb_flags,
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <tevent.h>
|
#include <tevent.h>
|
||||||
#include "libcli/util/ntstatus.h"
|
#include "libcli/util/ntstatus.h"
|
||||||
#include "tdb.h"
|
#include "tdb.h"
|
||||||
#include "lib/param/loadparm.h"
|
|
||||||
|
|
||||||
struct db_record;
|
struct db_record;
|
||||||
struct db_context;
|
struct db_context;
|
||||||
@ -231,7 +230,6 @@ TDB_DATA dbwrap_merge_dbufs(TALLOC_CTX *mem_ctx,
|
|||||||
* This opens a tdb file
|
* This opens a tdb file
|
||||||
*/
|
*/
|
||||||
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
int hash_size, int tdb_flags,
|
int hash_size, int tdb_flags,
|
||||||
int open_flags, mode_t mode,
|
int open_flags, mode_t mode,
|
||||||
|
@ -22,10 +22,8 @@
|
|||||||
#include "dbwrap/dbwrap.h"
|
#include "dbwrap/dbwrap.h"
|
||||||
#include "dbwrap/dbwrap_tdb.h"
|
#include "dbwrap/dbwrap_tdb.h"
|
||||||
#include "tdb.h"
|
#include "tdb.h"
|
||||||
#include "lib/param/param.h"
|
|
||||||
|
|
||||||
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
|
||||||
const char *name,
|
const char *name,
|
||||||
int hash_size, int tdb_flags,
|
int hash_size, int tdb_flags,
|
||||||
int open_flags, mode_t mode,
|
int open_flags, mode_t mode,
|
||||||
@ -34,14 +32,15 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
|||||||
{
|
{
|
||||||
struct db_context *db = NULL;
|
struct db_context *db = NULL;
|
||||||
|
|
||||||
if (hash_size == 0) {
|
db = db_open_tdb(
|
||||||
hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
|
mem_ctx,
|
||||||
}
|
name,
|
||||||
|
hash_size,
|
||||||
db = db_open_tdb(mem_ctx, name, hash_size,
|
tdb_flags,
|
||||||
lpcfg_tdb_flags(lp_ctx, tdb_flags),
|
open_flags,
|
||||||
open_flags, mode,
|
mode,
|
||||||
lock_order, dbwrap_flags);
|
lock_order,
|
||||||
|
dbwrap_flags);
|
||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,6 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
|
|||||||
|
|
||||||
global_db = dbwrap_local_open(
|
global_db = dbwrap_local_open(
|
||||||
NULL,
|
NULL,
|
||||||
lp_ctx,
|
|
||||||
fname,
|
fname,
|
||||||
hash_size,
|
hash_size,
|
||||||
tdb_flags,
|
tdb_flags,
|
||||||
|
@ -53,7 +53,6 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
db_sc = dbwrap_local_open(
|
db_sc = dbwrap_local_open(
|
||||||
mem_ctx,
|
mem_ctx,
|
||||||
lp_ctx,
|
|
||||||
fname,
|
fname,
|
||||||
hash_size,
|
hash_size,
|
||||||
tdb_flags,
|
tdb_flags,
|
||||||
|
@ -188,9 +188,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
|
|||||||
}
|
}
|
||||||
tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);
|
tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);
|
||||||
|
|
||||||
result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
|
result = dbwrap_local_open(
|
||||||
tdb_flags, open_flags, mode,
|
mem_ctx,
|
||||||
lock_order, dbwrap_flags);
|
name,
|
||||||
|
hash_size,
|
||||||
|
tdb_flags,
|
||||||
|
open_flags,
|
||||||
|
mode,
|
||||||
|
lock_order,
|
||||||
|
dbwrap_flags);
|
||||||
talloc_unlink(mem_ctx, lp_ctx);
|
talloc_unlink(mem_ctx, lp_ctx);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -66,7 +66,6 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
|
|||||||
|
|
||||||
db = dbwrap_local_open(
|
db = dbwrap_local_open(
|
||||||
mem_ctx,
|
mem_ctx,
|
||||||
lp_ctx,
|
|
||||||
path,
|
path,
|
||||||
hash_size,
|
hash_size,
|
||||||
tdb_flags,
|
tdb_flags,
|
||||||
|
Loading…
Reference in New Issue
Block a user