summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-26 14:31:16 +0000
committerJeremy Allison <jra@samba.org>2014-03-31 22:52:13 +0200
commit604b970d676fa9561781b0be6b373283410fa8ea (patch)
tree8c85f9a2d3dcc7abf51f3b9596eda13e894b4e45 /source3/lib
parent801b947e12530d9756aa687056362d497f198491 (diff)
downloadsamba-604b970d676fa9561781b0be6b373283410fa8ea.tar.gz
samba-604b970d676fa9561781b0be6b373283410fa8ea.tar.xz
samba-604b970d676fa9561781b0be6b373283410fa8ea.zip
serverid: Avoid passing lp_ctx to tdb_wrap_open in serverid_parent_init
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/serverid.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 5d5981825d0..4253da6378a 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -43,6 +43,7 @@ bool serverid_parent_init(TALLOC_CTX *mem_ctx)
{
struct tdb_wrap *db;
struct loadparm_context *lp_ctx;
+ const char *fname;
lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
if (lp_ctx == NULL) {
@@ -56,9 +57,14 @@ bool serverid_parent_init(TALLOC_CTX *mem_ctx)
* work.
*/
- db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
- 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT,
- 0644, lp_ctx);
+ fname = lock_path("serverid.tdb");
+
+ db = tdb_wrap_open_(mem_ctx, fname,
+ lpcfg_tdb_hash_size(lp_ctx, fname),
+ lpcfg_tdb_flags(lp_ctx,
+ TDB_DEFAULT|TDB_CLEAR_IF_FIRST|
+ TDB_INCOMPATIBLE_HASH),
+ O_RDWR|O_CREAT, 0644);
talloc_unlink(mem_ctx, lp_ctx);
if (db == NULL) {
DEBUG(1, ("could not open serverid.tdb: %s\n",