1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

mutex: Avoid passing lp_ctx to tdb_wrap_open in grab_named_mutex

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2014-03-26 14:35:31 +00:00 committed by Jeremy Allison
parent 994d75574b
commit 328afb8d3e

View File

@ -48,6 +48,8 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
{
struct named_mutex *result;
struct loadparm_context *lp_ctx;
const char *fname;
result = talloc(mem_ctx, struct named_mutex);
if (result == NULL) {
DEBUG(0, ("talloc failed\n"));
@ -68,11 +70,15 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
return NULL;
}
result->tdb = tdb_wrap_open(result, lock_path("mutex.tdb"), 0,
TDB_DEFAULT |
TDB_CLEAR_IF_FIRST |
TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0600, lp_ctx);
fname = lock_path("mutex.tdb");
result->tdb = tdb_wrap_open_(result, 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, 0600);
talloc_unlink(result, lp_ctx);
if (result->tdb == NULL) {
DEBUG(1, ("Could not open mutex.tdb: %s\n",