summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_ldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r--source3/passdb/pdb_ldap.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index ef9eb81fbb..1254dba2b8 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -3514,12 +3514,11 @@ static NTSTATUS ldapsam_get_account_policy(struct pdb_methods *methods, int poli
}
static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
- TALLOC_CTX *mem_ctx,
const DOM_SID *domain_sid,
int num_rids,
uint32 *rids,
- const char ***names,
- uint32 **attrs)
+ const char **names,
+ uint32 *attrs)
{
struct ldapsam_privates *ldap_state =
(struct ldapsam_privates *)methods->private_data;
@@ -3532,7 +3531,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
if (!lp_parm_bool(-1, "ldapsam", "trusted", False))
- return pdb_default_lookup_rids(methods, mem_ctx, domain_sid,
+ return pdb_default_lookup_rids(methods, domain_sid,
num_rids, rids, names, attrs);
if (!sid_equal(domain_sid, get_global_sam_sid())) {
@@ -3541,14 +3540,8 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
goto done;
}
- (*names) = TALLOC_ZERO_ARRAY(mem_ctx, const char *, num_rids);
- (*attrs) = TALLOC_ARRAY(mem_ctx, uint32, num_rids);
-
- if ((num_rids != 0) && (((*names) == NULL) || ((*attrs) == NULL)))
- return NT_STATUS_NO_MEMORY;
-
for (i=0; i<num_rids; i++)
- (*attrs)[i] = SID_NAME_UNKNOWN;
+ attrs[i] = SID_NAME_UNKNOWN;
allsids = SMB_STRDUP("");
if (allsids == NULL) return NT_STATUS_NO_MEMORY;
@@ -3618,9 +3611,9 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
continue;
}
- (*attrs)[rid_index] = SID_NAME_USER;
- (*names)[rid_index] = talloc_strdup(mem_ctx, str);
- if ((*names)[rid_index] == NULL) return NT_STATUS_NO_MEMORY;
+ attrs[rid_index] = SID_NAME_USER;
+ names[rid_index] = talloc_strdup(names, str);
+ if (names[rid_index] == NULL) return NT_STATUS_NO_MEMORY;
num_mapped += 1;
}
@@ -3683,9 +3676,9 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
continue;
}
- (*attrs)[rid_index] = SID_NAME_DOM_GRP;
- (*names)[rid_index] = talloc_strdup(mem_ctx, str);
- if ((*names)[rid_index] == NULL) return NT_STATUS_NO_MEMORY;
+ attrs[rid_index] = SID_NAME_DOM_GRP;
+ names[rid_index] = talloc_strdup(names, str);
+ if (names[rid_index] == NULL) return NT_STATUS_NO_MEMORY;
num_mapped += 1;
}