diff options
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index fc2d623160..b3118d772d 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -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; |