[PATCH] Remove loadparm dependency from dbwrap

Jeremy Allison jra at samba.org
Mon Apr 23 23:47:51 UTC 2018


On Wed, Apr 18, 2018 at 07:54:42AM +0200, Volker Lendecke via samba-technical wrote:
> Hi!
> 
> $SUBJECT says it all. If requested, we can squash a few of the
> patches.
> 
> Review appreciated!

Oh, really nice cleanup ! RB+ and pushed.

> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de

> From 144c91791f9efea15331966a322c762a4a6a65c6 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:18:50 +0200
> Subject: [PATCH 01/12] libcli: Call dbwrap_local_open with the correct hash
>  size
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  libcli/auth/schannel_state_tdb.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c
> index 6a19823f639..4b02261663a 100644
> --- a/libcli/auth/schannel_state_tdb.c
> +++ b/libcli/auth/schannel_state_tdb.c
> @@ -42,15 +42,24 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,
>  {
>  	struct db_context *db_sc = NULL;
>  	char *fname = lpcfg_private_db_path(mem_ctx, lp_ctx, "schannel_store");
> +	int hash_size;
>  
>  	if (!fname) {
>  		return NULL;
>  	}
>  
> -	db_sc = dbwrap_local_open(mem_ctx, lp_ctx, fname, 0,
> -				  TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
> -				  0600, DBWRAP_LOCK_ORDER_NONE,
> -				  DBWRAP_FLAG_NONE);
> +	hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
> +
> +	db_sc = dbwrap_local_open(
> +		mem_ctx,
> +		lp_ctx,
> +		fname,
> +		hash_size,
> +		TDB_CLEAR_IF_FIRST|TDB_NOSYNC,
> +		O_RDWR|O_CREAT,
> +		0600,
> +		DBWRAP_LOCK_ORDER_NONE,
> +		DBWRAP_FLAG_NONE);
>  
>  	if (!db_sc) {
>  		DEBUG(0,("open_schannel_session_store: Failed to open %s - %s\n",
> -- 
> 2.11.0
> 
> 
> From 346c84262d5a7b99f0e1b2872b9e6738c949dcdf Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:20:02 +0200
> Subject: [PATCH 02/12] libcli: Call dbwrap_local_open with the correct
>  tdb_flags
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  libcli/auth/schannel_state_tdb.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c
> index 4b02261663a..15554b2ed48 100644
> --- a/libcli/auth/schannel_state_tdb.c
> +++ b/libcli/auth/schannel_state_tdb.c
> @@ -42,20 +42,21 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,
>  {
>  	struct db_context *db_sc = NULL;
>  	char *fname = lpcfg_private_db_path(mem_ctx, lp_ctx, "schannel_store");
> -	int hash_size;
> +	int hash_size, tdb_flags;
>  
>  	if (!fname) {
>  		return NULL;
>  	}
>  
>  	hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
> +	tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_CLEAR_IF_FIRST|TDB_NOSYNC);
>  
>  	db_sc = dbwrap_local_open(
>  		mem_ctx,
>  		lp_ctx,
>  		fname,
>  		hash_size,
> -		TDB_CLEAR_IF_FIRST|TDB_NOSYNC,
> +		tdb_flags,
>  		O_RDWR|O_CREAT,
>  		0600,
>  		DBWRAP_LOCK_ORDER_NONE,
> -- 
> 2.11.0
> 
> 
> From 2f50a99d3764348f6c4fae5e15403fae5173abda Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:22:08 +0200
> Subject: [PATCH 03/12] credentials: Call dbwrap_local_open with the correct
>  hash size
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  auth/credentials/credentials_secrets.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c
> index 8d2a3b7a46e..b22654e370e 100644
> --- a/auth/credentials/credentials_secrets.c
> +++ b/auth/credentials/credentials_secrets.c
> @@ -238,16 +238,25 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
>  {
>  	struct db_context *db_ctx;
>  	char *secrets_tdb_path;
> +	int hash_size;
>  
>  	secrets_tdb_path = lpcfg_private_db_path(cred, lp_ctx, "secrets");
>  	if (secrets_tdb_path == NULL) {
>  		return NT_STATUS_NO_MEMORY;
>  	}
>  
> -	db_ctx = dbwrap_local_open(cred, lp_ctx, secrets_tdb_path, 0,
> -				   TDB_DEFAULT, O_RDWR, 0600,
> -				   DBWRAP_LOCK_ORDER_1,
> -				   DBWRAP_FLAG_NONE);
> +	hash_size = lpcfg_tdb_hash_size(lp_ctx, secrets_tdb_path);
> +
> +	db_ctx = dbwrap_local_open(
> +		cred,
> +		lp_ctx,
> +		secrets_tdb_path,
> +		hash_size,
> +		TDB_DEFAULT,
> +		O_RDWR,
> +		0600,
> +		DBWRAP_LOCK_ORDER_1,
> +		DBWRAP_FLAG_NONE);
>  	TALLOC_FREE(secrets_tdb_path);
>  
>  	/*
> -- 
> 2.11.0
> 
> 
> From 16c1b47289be686cfcf133ee787cacde9a6183a6 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:23:03 +0200
> Subject: [PATCH 04/12] credentials: Call dbwrap_local_open with the correct
>  tdb_flags
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  auth/credentials/credentials_secrets.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c
> index b22654e370e..23d28f1917d 100644
> --- a/auth/credentials/credentials_secrets.c
> +++ b/auth/credentials/credentials_secrets.c
> @@ -238,7 +238,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
>  {
>  	struct db_context *db_ctx;
>  	char *secrets_tdb_path;
> -	int hash_size;
> +	int hash_size, tdb_flags;
>  
>  	secrets_tdb_path = lpcfg_private_db_path(cred, lp_ctx, "secrets");
>  	if (secrets_tdb_path == NULL) {
> @@ -246,13 +246,14 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
>  	}
>  
>  	hash_size = lpcfg_tdb_hash_size(lp_ctx, secrets_tdb_path);
> +	tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT);
>  
>  	db_ctx = dbwrap_local_open(
>  		cred,
>  		lp_ctx,
>  		secrets_tdb_path,
>  		hash_size,
> -		TDB_DEFAULT,
> +		tdb_flags,
>  		O_RDWR,
>  		0600,
>  		DBWRAP_LOCK_ORDER_1,
> -- 
> 2.11.0
> 
> 
> From efce2592ff8e828a437c8c49e87756966f47b90f Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:25:19 +0200
> Subject: [PATCH 05/12] cluster4: Call dbwrap_local_open with the correct hash
>  size
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source4/cluster/local.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/source4/cluster/local.c b/source4/cluster/local.c
> index 5ef58c91bf6..d4c16b00cce 100644
> --- a/source4/cluster/local.c
> +++ b/source4/cluster/local.c
> @@ -55,12 +55,24 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
>  	TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
>  	char *path, *dbname;
>  	struct db_context *db;
> +	int hash_size;
>  
>  	dbname = talloc_asprintf(mem_ctx, "%s.tdb", dbbase);
>  
>  	path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
> -	db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
> -			       0600, DBWRAP_LOCK_ORDER_NONE, DBWRAP_FLAG_NONE);
> +
> +	hash_size = lpcfg_tdb_hash_size(lp_ctx, path);
> +
> +	db = dbwrap_local_open(
> +		mem_ctx,
> +		lp_ctx,
> +		path,
> +		hash_size,
> +		flags,
> +		O_RDWR|O_CREAT,
> +		0600,
> +		DBWRAP_LOCK_ORDER_NONE,
> +		DBWRAP_FLAG_NONE);
>  	talloc_free(tmp_ctx);
>  	return db;
>  }
> -- 
> 2.11.0
> 
> 
> From 7f0f842bac02bd62df059a65084f8ac2f170a85d Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:26:27 +0200
> Subject: [PATCH 06/12] cluster4: Call dbwrap_local_open with the correct
>  tdb_flags
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source4/cluster/local.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/source4/cluster/local.c b/source4/cluster/local.c
> index d4c16b00cce..d871dcbd3f9 100644
> --- a/source4/cluster/local.c
> +++ b/source4/cluster/local.c
> @@ -55,20 +55,21 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
>  	TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
>  	char *path, *dbname;
>  	struct db_context *db;
> -	int hash_size;
> +	int hash_size, tdb_flags;
>  
>  	dbname = talloc_asprintf(mem_ctx, "%s.tdb", dbbase);
>  
>  	path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
>  
>  	hash_size = lpcfg_tdb_hash_size(lp_ctx, path);
> +	tdb_flags = lpcfg_tdb_flags(lp_ctx, flags);
>  
>  	db = dbwrap_local_open(
>  		mem_ctx,
>  		lp_ctx,
>  		path,
>  		hash_size,
> -		flags,
> +		tdb_flags,
>  		O_RDWR|O_CREAT,
>  		0600,
>  		DBWRAP_LOCK_ORDER_NONE,
> -- 
> 2.11.0
> 
> 
> From 1bb86a3d1626ca4d2973ed34c5373a7e7148b6e5 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:31:28 +0200
> Subject: [PATCH 07/12] dbwrap3: Call dbwrap_local_open with the correct hash
>  size
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source3/lib/dbwrap/dbwrap_open.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
> index 658ccb602a8..d6c19e3d107 100644
> --- a/source3/lib/dbwrap/dbwrap_open.c
> +++ b/source3/lib/dbwrap/dbwrap_open.c
> @@ -182,6 +182,11 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
>  
>  	if (result == NULL) {
>  		struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
> +
> +		if (hash_size == 0) {
> +			hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
> +		}
> +
>  		result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
>  					   tdb_flags, open_flags, mode,
>  					   lock_order, dbwrap_flags);
> -- 
> 2.11.0
> 
> 
> From 649bb04ffcb039145dea7fb39c5eca10e657d7a4 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:32:20 +0200
> Subject: [PATCH 08/12] dbwrap3: Call dbwrap_local_open with the correct tdb
>  flags
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source3/lib/dbwrap/dbwrap_open.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
> index d6c19e3d107..e05e011d0d4 100644
> --- a/source3/lib/dbwrap/dbwrap_open.c
> +++ b/source3/lib/dbwrap/dbwrap_open.c
> @@ -186,6 +186,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
>  		if (hash_size == 0) {
>  			hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
>  		}
> +		tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);
>  
>  		result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
>  					   tdb_flags, open_flags, mode,
> -- 
> 2.11.0
> 
> 
> From 9435a5d4ce931e7c8dc17a49f905a529675d7cc8 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:38:27 +0200
> Subject: [PATCH 09/12] libcli: Call dbwrap_local_open with the correct hash
>  size
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  libcli/auth/netlogon_creds_cli.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c
> index fdd1195b183..f3e8ed1209c 100644
> --- a/libcli/auth/netlogon_creds_cli.c
> +++ b/libcli/auth/netlogon_creds_cli.c
> @@ -215,6 +215,7 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
>  {
>  	char *fname;
>  	struct db_context *global_db;
> +	int hash_size;
>  
>  	if (netlogon_creds_cli_global_db != NULL) {
>  		return NT_STATUS_OK;
> @@ -225,12 +226,18 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
>  		return NT_STATUS_NO_MEMORY;
>  	}
>  
> -	global_db = dbwrap_local_open(NULL, lp_ctx,
> -				      fname, 0,
> -				      TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
> -				      O_RDWR|O_CREAT,
> -				      0600, DBWRAP_LOCK_ORDER_2,
> -				      DBWRAP_FLAG_NONE);
> +	hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
> +
> +	global_db = dbwrap_local_open(
> +		NULL,
> +		lp_ctx,
> +		fname,
> +		hash_size,
> +		TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
> +		O_RDWR|O_CREAT,
> +		0600,
> +		DBWRAP_LOCK_ORDER_2,
> +		DBWRAP_FLAG_NONE);
>  	if (global_db == NULL) {
>  		DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s - %s\n",
>  			 fname, strerror(errno)));
> -- 
> 2.11.0
> 
> 
> From 13fa2e9f7ccf96de6883e80416533fdc33d636e3 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:39:46 +0200
> Subject: [PATCH 10/12] libcli: Call dbwrap_local_open with the correct tdb
>  flags
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  libcli/auth/netlogon_creds_cli.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c
> index f3e8ed1209c..9b7e4e2517c 100644
> --- a/libcli/auth/netlogon_creds_cli.c
> +++ b/libcli/auth/netlogon_creds_cli.c
> @@ -215,7 +215,7 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
>  {
>  	char *fname;
>  	struct db_context *global_db;
> -	int hash_size;
> +	int hash_size, tdb_flags;
>  
>  	if (netlogon_creds_cli_global_db != NULL) {
>  		return NT_STATUS_OK;
> @@ -227,13 +227,16 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
>  	}
>  
>  	hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
> +	tdb_flags = lpcfg_tdb_flags(
> +		lp_ctx,
> +		TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH);
>  
>  	global_db = dbwrap_local_open(
>  		NULL,
>  		lp_ctx,
>  		fname,
>  		hash_size,
> -		TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
> +		tdb_flags,
>  		O_RDWR|O_CREAT,
>  		0600,
>  		DBWRAP_LOCK_ORDER_2,
> -- 
> 2.11.0
> 
> 
> From 4fd074fed92f3f67c5ed6de161c5c0795fc96f57 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:45:45 +0200
> Subject: [PATCH 11/12] dbwrap: Remove calls to loadparm
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  auth/credentials/credentials_secrets.c |  1 -
>  lib/dbwrap/dbwrap.h                    |  2 --
>  lib/dbwrap/dbwrap_local_open.c         | 19 +++++++++----------
>  libcli/auth/netlogon_creds_cli.c       |  1 -
>  libcli/auth/schannel_state_tdb.c       |  1 -
>  source3/lib/dbwrap/dbwrap_open.c       | 12 +++++++++---
>  source4/cluster/local.c                |  1 -
>  7 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c
> index 23d28f1917d..54f3ce2d078 100644
> --- a/auth/credentials/credentials_secrets.c
> +++ b/auth/credentials/credentials_secrets.c
> @@ -250,7 +250,6 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
>  
>  	db_ctx = dbwrap_local_open(
>  		cred,
> -		lp_ctx,
>  		secrets_tdb_path,
>  		hash_size,
>  		tdb_flags,
> diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h
> index 1161bf0a493..6a0f7b1ee2e 100644
> --- a/lib/dbwrap/dbwrap.h
> +++ b/lib/dbwrap/dbwrap.h
> @@ -25,7 +25,6 @@
>  #include <tevent.h>
>  #include "libcli/util/ntstatus.h"
>  #include "tdb.h"
> -#include "lib/param/loadparm.h"
>  
>  struct db_record;
>  struct db_context;
> @@ -231,7 +230,6 @@ TDB_DATA dbwrap_merge_dbufs(TALLOC_CTX *mem_ctx,
>   * This opens a tdb file
>   */
>  struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
> -				     struct loadparm_context *lp_ctx,
>  				     const char *name,
>  				     int hash_size, int tdb_flags,
>  				     int open_flags, mode_t mode,
> diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c
> index c350fd3ea42..20c5fa0e1d2 100644
> --- a/lib/dbwrap/dbwrap_local_open.c
> +++ b/lib/dbwrap/dbwrap_local_open.c
> @@ -22,10 +22,8 @@
>  #include "dbwrap/dbwrap.h"
>  #include "dbwrap/dbwrap_tdb.h"
>  #include "tdb.h"
> -#include "lib/param/param.h"
>  
>  struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
> -				     struct loadparm_context *lp_ctx,
>  				     const char *name,
>  				     int hash_size, int tdb_flags,
>  				     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;
>  
> -	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);
> +	db = db_open_tdb(
> +		mem_ctx,
> +		name,
> +		hash_size,
> +		tdb_flags,
> +		open_flags,
> +		mode,
> +		lock_order,
> +		dbwrap_flags);
>  
>  	return db;
>  }
> diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c
> index 9b7e4e2517c..817d2cd041a 100644
> --- a/libcli/auth/netlogon_creds_cli.c
> +++ b/libcli/auth/netlogon_creds_cli.c
> @@ -233,7 +233,6 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
>  
>  	global_db = dbwrap_local_open(
>  		NULL,
> -		lp_ctx,
>  		fname,
>  		hash_size,
>  		tdb_flags,
> diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c
> index 15554b2ed48..ce20012ac22 100644
> --- a/libcli/auth/schannel_state_tdb.c
> +++ b/libcli/auth/schannel_state_tdb.c
> @@ -53,7 +53,6 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,
>  
>  	db_sc = dbwrap_local_open(
>  		mem_ctx,
> -		lp_ctx,
>  		fname,
>  		hash_size,
>  		tdb_flags,
> diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
> index e05e011d0d4..a4d5184396d 100644
> --- a/source3/lib/dbwrap/dbwrap_open.c
> +++ b/source3/lib/dbwrap/dbwrap_open.c
> @@ -188,9 +188,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
>  		}
>  		tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);
>  
> -		result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
> -					   tdb_flags, open_flags, mode,
> -					   lock_order, dbwrap_flags);
> +		result = dbwrap_local_open(
> +			mem_ctx,
> +			name,
> +			hash_size,
> +			tdb_flags,
> +			open_flags,
> +			mode,
> +			lock_order,
> +			dbwrap_flags);
>  		talloc_unlink(mem_ctx, lp_ctx);
>  	}
>  	return result;
> diff --git a/source4/cluster/local.c b/source4/cluster/local.c
> index d871dcbd3f9..ea3666322a5 100644
> --- a/source4/cluster/local.c
> +++ b/source4/cluster/local.c
> @@ -66,7 +66,6 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
>  
>  	db = dbwrap_local_open(
>  		mem_ctx,
> -		lp_ctx,
>  		path,
>  		hash_size,
>  		tdb_flags,
> -- 
> 2.11.0
> 
> 
> From faf3d9fbed33930740c106b42ed94fda2a52026f Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 17 Apr 2018 16:46:00 +0200
> Subject: [PATCH 12/12] dbwrap: Remove dependency on samba-hostconfig
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  lib/dbwrap/wscript_build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/dbwrap/wscript_build b/lib/dbwrap/wscript_build
> index e6e9d5e4384..0e5f9619a3f 100644
> --- a/lib/dbwrap/wscript_build
> +++ b/lib/dbwrap/wscript_build
> @@ -1,6 +1,6 @@
>  SRC = '''dbwrap.c dbwrap_util.c dbwrap_rbt.c dbwrap_tdb.c
>           dbwrap_local_open.c'''
> -DEPS= '''samba-util util_tdb samba-errors tdb tdb-wrap samba-hostconfig tevent tevent-util'''
> +DEPS= '''samba-util util_tdb samba-errors tdb tdb-wrap tevent tevent-util'''
>  
>  bld.SAMBA_LIBRARY('dbwrap',
>                    source=SRC,
> -- 
> 2.11.0
> 




More information about the samba-technical mailing list