summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-11-04 15:48:10 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-11-04 16:06:57 +1100
commit31158c02568c28507a8a405328c457d144ac6829 (patch)
treed217d8262cd40e394ad049eb6160c179edfbed0c
parent2fc5ca8409ba0ad40236608bc1ca5f4f5f39445a (diff)
downloadsamba-31158c02568c28507a8a405328c457d144ac6829.tar.gz
samba-31158c02568c28507a8a405328c457d144ac6829.tar.bz2
samba-31158c02568c28507a8a405328c457d144ac6829.zip
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
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c9
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;