diff options
author | Günther Deschner <gd@samba.org> | 2008-11-05 13:37:49 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-11-10 21:46:29 +0100 |
commit | 2efec54b8d8ae37b57747459ac7aa3c7a69cb6cc (patch) | |
tree | 30a1861ca4893c59abaa69a4038ffc2fc91d9add /source4/rpc_server/samr/dcesrv_samr.c | |
parent | aaca059a35fd0b53ea3b726a073f8270f4bf1c01 (diff) | |
download | samba-2efec54b8d8ae37b57747459ac7aa3c7a69cb6cc.tar.gz samba-2efec54b8d8ae37b57747459ac7aa3c7a69cb6cc.tar.bz2 samba-2efec54b8d8ae37b57747459ac7aa3c7a69cb6cc.zip |
s4-samr: merge samr_EnumDomainAliases from s3 idl. (fixme: python)
Guenther
Diffstat (limited to 'source4/rpc_server/samr/dcesrv_samr.c')
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index fe001c30ef..956c1644e8 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -1700,10 +1700,11 @@ static NTSTATUS dcesrv_samr_EnumDomainAliases(struct dcesrv_call_state *dce_call int ldb_cnt, count, i, first; struct samr_SamEntry *entries; const char * const attrs[3] = { "objectSid", "sAMAccountName", NULL }; + struct samr_SamArray *sam; *r->out.resume_handle = 0; - r->out.sam = NULL; - r->out.num_entries = 0; + *r->out.sam = NULL; + *r->out.num_entries = 0; DCESRV_PULL_HANDLE(h, r->in.domain_handle, SAMR_HANDLE_DOMAIN); @@ -1763,20 +1764,22 @@ static NTSTATUS dcesrv_samr_EnumDomainAliases(struct dcesrv_call_state *dce_call return NT_STATUS_OK; } - r->out.num_entries = count - first; - r->out.num_entries = MIN(r->out.num_entries, 1000); + *r->out.num_entries = count - first; + *r->out.num_entries = MIN(*r->out.num_entries, 1000); - r->out.sam = talloc(mem_ctx, struct samr_SamArray); - if (!r->out.sam) { + sam = talloc(mem_ctx, struct samr_SamArray); + if (!sam) { return NT_STATUS_NO_MEMORY; } - r->out.sam->entries = entries+first; - r->out.sam->count = r->out.num_entries; + sam->entries = entries+first; + sam->count = *r->out.num_entries; - if (r->out.num_entries < count - first) { + *r->out.sam = sam; + + if (*r->out.num_entries < count - first) { *r->out.resume_handle = - entries[first+r->out.num_entries-1].idx; + entries[first+*r->out.num_entries-1].idx; return STATUS_MORE_ENTRIES; } |