From 72eacda263b0a3b896b8eef46a00a9e6ddb8564d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Filipensk=C3=BD?= Date: Mon, 11 Jul 2022 22:41:46 +0200 Subject: [PATCH] s3:winbind: Change num_sids from int to uint32_t in wb_lookupusergroups_recv() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider --- source3/winbindd/wb_gettoken.c | 24 ++++++++++++------------ source3/winbindd/wb_lookupusergroups.c | 8 ++++---- source3/winbindd/winbindd_proto.h | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c index 63c5ce816fc..dd8f0d37e71 100644 --- a/source3/winbindd/wb_gettoken.c +++ b/source3/winbindd/wb_gettoken.c @@ -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; } diff --git a/source3/winbindd/wb_lookupusergroups.c b/source3/winbindd/wb_lookupusergroups.c index de3d184fa99..3ec25b49393 100644 --- a/source3/winbindd/wb_lookupusergroups.c +++ b/source3/winbindd/wb_lookupusergroups.c @@ -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; } diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index b2e33098cf9..870112b3c0f 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -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, -- 2.47.3