1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Use ldb_dn_from_ldb_val() to create a DN in the SAMR server

The previous code incorrectly cast an ldb_val into a char *.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2008-11-04 15:48:10 +11:00
parent 2fc5ca8409
commit 31158c0256

View File

@ -2824,8 +2824,13 @@ static NTSTATUS dcesrv_samr_GetMembersInAlias(struct dcesrv_call_state *dce_call
ret = gendb_search_dn(d_state->sam_ctx, mem_ctx,
a_state->account_dn, &msgs, attrs);
if (ret != 1)
if (ret == -1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
} else if (ret == 0) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
} else if (ret != 1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
r->out.sids->num_sids = 0;
r->out.sids->sids = NULL;
@ -2845,7 +2850,7 @@ static NTSTATUS dcesrv_samr_GetMembersInAlias(struct dcesrv_call_state *dce_call
struct ldb_message **msgs2;
const char * const attrs2[2] = { "objectSid", NULL };
ret = gendb_search_dn(a_state->sam_ctx, mem_ctx,
ldb_dn_new(mem_ctx, a_state->sam_ctx, &el->values[i]),
ldb_dn_from_ldb_val(mem_ctx, a_state->sam_ctx, &el->values[i]),
&msgs2, attrs2);
if (ret != 1)
return NT_STATUS_INTERNAL_DB_CORRUPTION;