summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-16 17:06:17 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:43 +0200
commit77096b9a26b23edc6a059dc2bc4f56d26f4aa0ea (patch)
tree3b5cdc7f7127dddd4cf6d8b1e05a32d980b9a164 /source3/winbindd
parent863212ad0e5ae59a218d9960553ec1e946f17826 (diff)
downloadsamba-77096b9a26b23edc6a059dc2bc4f56d26f4aa0ea.tar.gz
samba-77096b9a26b23edc6a059dc2bc4f56d26f4aa0ea.tar.bz2
samba-77096b9a26b23edc6a059dc2bc4f56d26f4aa0ea.zip
s3:idmap_tdb2: pass idmap_domain (not idmap_tdb2_context) to idmap_tdb2_sid_to_id
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_tdb2.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index 288e89b929..5f813580fe 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -637,17 +637,20 @@ done:
/*
Single sid to id lookup function.
*/
-static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_tdb2_context *ctx, struct id_map *map)
+static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_domain *dom, struct id_map *map)
{
NTSTATUS ret;
TDB_DATA data;
char *keystr;
unsigned long rec_id = 0;
+ struct idmap_tdb2_context *ctx;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
ret = idmap_tdb2_open_db();
NT_STATUS_NOT_OK_RETURN(ret);
+ ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context);
+
keystr = sid_string_talloc(tmp_ctx, map->sid);
if (keystr == NULL) {
DEBUG(0, ("Out of memory!\n"));
@@ -791,7 +794,6 @@ static NTSTATUS idmap_tdb2_sids_to_unixids_action(struct db_context *db,
{
struct idmap_tdb2_sids_to_unixids_context *state;
int i;
- struct idmap_tdb2_context *ctx;
NTSTATUS ret = NT_STATUS_OK;
state = (struct idmap_tdb2_sids_to_unixids_context *)private_data;
@@ -801,10 +803,6 @@ static NTSTATUS idmap_tdb2_sids_to_unixids_action(struct db_context *db,
state->dom->name,
state->allocate_unmapped ? "yes" : "no"));
- ctx = talloc_get_type(state->dom->private_data,
- struct idmap_tdb2_context);
-
-
for (i = 0; state->ids[i]; i++) {
if ((state->ids[i]->status == ID_UNKNOWN) ||
/* retry if we could not map in previous run: */
@@ -812,7 +810,7 @@ static NTSTATUS idmap_tdb2_sids_to_unixids_action(struct db_context *db,
{
NTSTATUS ret2;
- ret2 = idmap_tdb2_sid_to_id(ctx, state->ids[i]);
+ ret2 = idmap_tdb2_sid_to_id(state->dom, state->ids[i]);
if (!NT_STATUS_IS_OK(ret2)) {
/* if it is just a failed mapping, continue */