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

s3:winbind: Change num_sids from int to uint32_t in wb_lookupusergroups_recv()

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Pavel Filipenský 2022-07-11 22:41:46 +02:00 committed by Andreas Schneider
parent 51250c6142
commit 72eacda263
3 changed files with 17 additions and 17 deletions

View File

@ -36,7 +36,7 @@ static NTSTATUS wb_add_rids_to_sids(TALLOC_CTX *mem_ctx,
uint32_t *pnum_sids,
struct dom_sid **psids,
const struct dom_sid *domain_sid,
int num_rids, uint32_t *rids);
uint32_t num_rids, uint32_t *rids);
static void wb_gettoken_gotuser(struct tevent_req *subreq);
static void wb_gettoken_gotgroups(struct tevent_req *subreq);
@ -127,7 +127,7 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
return;
}
D_DEBUG("Received %d group(s).\n", num_groups);
D_DEBUG("Received %u group(s).\n", num_groups);
for (i = 0; i < num_groups; i++) {
D_DEBUG("Adding SID %s.\n", dom_sid_str_buf(&groups[i], &buf));
status = add_sid_to_array_unique(
@ -153,7 +153,7 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
return;
}
D_DEBUG("Expand domain's aliases for %d SIDs.\n", state->num_sids);
D_DEBUG("Expand domain's aliases for %u SID(s).\n", state->num_sids);
subreq = wb_lookupuseraliases_send(state, state->ev, domain,
state->num_sids, state->sids);
if (tevent_req_nomem(subreq, req)) {
@ -179,7 +179,7 @@ static void wb_gettoken_gotlocalgroups(struct tevent_req *subreq)
return;
}
D_DEBUG("Got %d RID(s).\n", num_rids);
D_DEBUG("Got %u RID(s).\n", num_rids);
status = wb_add_rids_to_sids(state, &state->num_sids, &state->sids,
get_global_sam_sid(), num_rids, rids);
if (tevent_req_nterror(req, status)) {
@ -191,7 +191,7 @@ static void wb_gettoken_gotlocalgroups(struct tevent_req *subreq)
* Now expand the builtin groups
*/
D_DEBUG("Expand the builtin groups for %d SID(s).\n", state->num_sids);
D_DEBUG("Expand the builtin groups for %u SID(s).\n", state->num_sids);
domain = find_domain_from_sid(&global_sid_Builtin);
if (domain == NULL) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
@ -221,7 +221,7 @@ static void wb_gettoken_gotbuiltins(struct tevent_req *subreq)
if (tevent_req_nterror(req, status)) {
return;
}
D_DEBUG("Got %d RID(s).\n", num_rids);
D_DEBUG("Got %u RID(s).\n", num_rids);
status = wb_add_rids_to_sids(state, &state->num_sids, &state->sids,
&global_sid_Builtin, num_rids, rids);
if (tevent_req_nterror(req, status)) {
@ -242,10 +242,10 @@ NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
return status;
}
*num_sids = state->num_sids;
D_INFO("WB command gettoken end.\nReceived %d SID(s).\n", state->num_sids);
D_INFO("WB command gettoken end.\nReceived %u SID(s).\n", state->num_sids);
for (i = 0; i < state->num_sids; i++) {
struct dom_sid_buf sidbuf;
D_INFO("%d: %s\n", i, dom_sid_str_buf(&state->sids[i], &sidbuf));
D_INFO("%u: %s\n", i, dom_sid_str_buf(&state->sids[i], &sidbuf));
}
*sids = talloc_move(mem_ctx, &state->sids);
@ -256,11 +256,11 @@ static NTSTATUS wb_add_rids_to_sids(TALLOC_CTX *mem_ctx,
uint32_t *pnum_sids,
struct dom_sid **psids,
const struct dom_sid *domain_sid,
int num_rids, uint32_t *rids)
uint32_t num_rids, uint32_t *rids)
{
int i;
uint32_t i;
D_DEBUG("%u SID(s) will be uniquely added to the SID array.\n"
"Before the addition the array has %d SID(s).\n",
"Before the addition the array has %u SID(s).\n",
num_rids, *pnum_sids);
for (i = 0; i < num_rids; i++) {
NTSTATUS status;
@ -274,6 +274,6 @@ static NTSTATUS wb_add_rids_to_sids(TALLOC_CTX *mem_ctx,
return status;
}
}
D_DEBUG("After the addition the array has %d SID(s).\n", *pnum_sids);
D_DEBUG("After the addition the array has %u SID(s).\n", *pnum_sids);
return NT_STATUS_OK;
}

View File

@ -94,12 +94,12 @@ static void wb_lookupusergroups_done(struct tevent_req *subreq)
}
NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
int *num_sids, struct dom_sid **sids)
uint32_t *num_sids, struct dom_sid **sids)
{
struct wb_lookupusergroups_state *state = tevent_req_data(
req, struct wb_lookupusergroups_state);
NTSTATUS status;
int i;
uint32_t i;
if (tevent_req_is_nterror(req, &status)) {
return status;
@ -107,11 +107,11 @@ NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
*num_sids = state->sids.num_sids;
*sids = talloc_move(mem_ctx, &state->sids.sids);
D_INFO("WB command lookupusergroups end.\nReceived %d SID(s).\n",
D_INFO("WB command lookupusergroups end.\nReceived %u SID(s).\n",
*num_sids);
for (i = 0; i < *num_sids; i++) {
struct dom_sid_buf buf;
D_INFO("%d: %s\n", i, dom_sid_str_buf(&*sids[i], &buf));
D_INFO("%u: %s\n", i, dom_sid_str_buf(&*sids[i], &buf));
}
return NT_STATUS_OK;
}

View File

@ -663,7 +663,7 @@ struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
const struct dom_sid *sid);
NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
int *num_sids, struct dom_sid **sids);
uint32_t *num_sids, struct dom_sid **sids);
struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,