From bd4cc44c7d99dd2aeabed73ef0659909b78c6830 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jun 2010 17:21:27 +0200 Subject: s3:idmap_tdb2: add an idmap_domain struct argument to idmap_tdb2_open_db() --- source3/winbindd/idmap_tdb2.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/winbindd/idmap_tdb2.c') diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index e6d5bb4290..980992773c 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -99,7 +99,7 @@ static NTSTATUS idmap_tdb2_load_ranges(void) /* open the permanent tdb */ -static NTSTATUS idmap_tdb2_open_db(void) +static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom) { char *db_path; @@ -241,7 +241,7 @@ static NTSTATUS idmap_tdb2_allocate_id(struct idmap_domain *dom, NTSTATUS status; struct idmap_tdb2_allocate_id_context state; - status = idmap_tdb2_open_db(); + status = idmap_tdb2_open_db(dom); NT_STATUS_NOT_OK_RETURN(status); /* Get current high water mark */ @@ -349,13 +349,13 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom, talloc_free(config_option); } - ret = idmap_tdb2_open_db(); + dom->private_data = ctx; + + ret = idmap_tdb2_open_db(dom); if (!NT_STATUS_IS_OK(ret)) { goto failed; } - dom->private_data = ctx; - return NT_STATUS_OK; failed: @@ -494,13 +494,13 @@ static NTSTATUS idmap_tdb2_id_to_sid(struct idmap_domain *dom, struct id_map *ma struct idmap_tdb2_context *ctx; - status = idmap_tdb2_open_db(); - NT_STATUS_NOT_OK_RETURN(status); - if (!dom || !map) { return NT_STATUS_INVALID_PARAMETER; } + status = idmap_tdb2_open_db(dom); + NT_STATUS_NOT_OK_RETURN(status); + ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); /* apply filters before checking */ @@ -598,7 +598,7 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_domain *dom, struct id_map *ma struct idmap_tdb2_context *ctx; TALLOC_CTX *tmp_ctx = talloc_stackframe(); - ret = idmap_tdb2_open_db(); + ret = idmap_tdb2_open_db(dom); NT_STATUS_NOT_OK_RETURN(ret); ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); -- cgit