diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-24 22:01:36 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-24 22:01:36 +0200 |
commit | 189950ce0615806b20a5536e6621d541044be42d (patch) | |
tree | 3d07ad6d3b4116733236df74479450f99481ac14 | |
parent | 4d76c0aa80e58ce944419bf36c695e7104c73712 (diff) | |
download | samba-189950ce0615806b20a5536e6621d541044be42d.tar.gz samba-189950ce0615806b20a5536e6621d541044be42d.tar.bz2 samba-189950ce0615806b20a5536e6621d541044be42d.zip |
s4:dsdb_enum_group_mem - use "unsigned" counters
"size_t" counters aren't really needed here (we don't check data lengths).
And we save the result in a certain "num_sids" variable which is of type
"unsigned".
-rw-r--r-- | source4/dsdb/common/util_samr.c | 5 | ||||
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/source4/dsdb/common/util_samr.c b/source4/dsdb/common/util_samr.c index 94d29647ee..6a14f0a4f4 100644 --- a/source4/dsdb/common/util_samr.c +++ b/source4/dsdb/common/util_samr.c @@ -410,10 +410,11 @@ NTSTATUS dsdb_enum_group_mem(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct dom_sid **members_out, - size_t *pnum_members) + unsigned int *pnum_members) { struct ldb_message *msg; - int i, ret; + unsigned int i; + int ret; struct dom_sid *members; struct ldb_message_element *member_el; const char *attrs[] = { "member", NULL }; diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 246a2e1ffc..fafa9d6a16 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -2113,9 +2113,8 @@ static NTSTATUS dcesrv_samr_QueryGroupMember(struct dcesrv_call_state *dce_call, struct dcesrv_handle *h; struct samr_account_state *a_state; struct samr_RidTypeArray *array; - size_t i; + unsigned int i, num_members; struct dom_sid *members_as_sids; - size_t num_members; struct dom_sid *dom_sid; DCESRV_PULL_HANDLE(h, r->in.group_handle, SAMR_HANDLE_GROUP); @@ -2516,9 +2515,8 @@ static NTSTATUS dcesrv_samr_GetMembersInAlias(struct dcesrv_call_state *dce_call struct samr_account_state *a_state; struct samr_domain_state *d_state; struct lsa_SidPtr *sids; - size_t i; + unsigned int i, num_members; struct dom_sid *members; - size_t num_members; NTSTATUS status; DCESRV_PULL_HANDLE(h, r->in.alias_handle, SAMR_HANDLE_ALIAS); @@ -2544,12 +2542,12 @@ static NTSTATUS dcesrv_samr_GetMembersInAlias(struct dcesrv_call_state *dce_call return NT_STATUS_NO_MEMORY; for (i=0; i<num_members; i++) { - sids[i].sid = dom_sid_dup(sids, &members[i]); if (sids[i].sid == NULL) { return NT_STATUS_NO_MEMORY; } } + r->out.sids->num_sids = num_members; r->out.sids->sids = sids; |