From cf33679d787b3848d1f4e34ca709bf48d2ce9a6c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Filipensk=C3=BD?= Date: Thu, 14 Jul 2022 13:19:44 +0200 Subject: [PATCH] s3:winbind: Change max_groups, num_groups from int to uint32_t in getpwent_state 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/winbindd.h | 4 ++-- source3/winbindd/winbindd_getgrent.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h index 6de31e0ff71..093a9fad11e 100644 --- a/source3/winbindd/winbindd.h +++ b/source3/winbindd/winbindd.h @@ -75,8 +75,8 @@ struct getpwent_state { struct getgrent_state { struct winbindd_domain *domain; - int next_group; - int num_groups; + uint32_t next_group; + uint32_t num_groups; struct wbint_Principal *groups; }; diff --git a/source3/winbindd/winbindd_getgrent.c b/source3/winbindd/winbindd_getgrent.c index bcec1c6aeb8..d87522f1570 100644 --- a/source3/winbindd/winbindd_getgrent.c +++ b/source3/winbindd/winbindd_getgrent.c @@ -23,8 +23,8 @@ struct winbindd_getgrent_state { struct tevent_context *ev; struct winbindd_cli_state *cli; - int max_groups; - int num_groups; + uint32_t max_groups; + uint32_t num_groups; struct winbindd_gr *groups; struct db_context **members; }; @@ -49,7 +49,7 @@ struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx, state->cli = cli; D_NOTICE("[%s (%u)] Winbind external command GETGRENT start.\n" - "The caller (%s) provided room for %d entries.\n", + "The caller (%s) provided room for %u entries.\n", cli->client_name, (unsigned int)cli->pid, cli->client_name, @@ -102,8 +102,8 @@ static void winbindd_getgrent_done(struct tevent_req *subreq) &state->members[state->num_groups]); TALLOC_FREE(subreq); if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) { - D_WARNING("winbindd_getgrent_done: done with %d groups\n", - (int)state->num_groups); + D_WARNING("winbindd_getgrent_done: done with %u groups\n", + state->num_groups); TALLOC_FREE(state->cli->grent_state); tevent_req_done(req); return; @@ -114,8 +114,8 @@ static void winbindd_getgrent_done(struct tevent_req *subreq) } state->num_groups += 1; if (state->num_groups >= state->max_groups) { - D_DEBUG("winbindd_getgrent_done: Got enough groups: %d\n", - (int)state->num_groups); + D_DEBUG("winbindd_getgrent_done: Got enough groups: %u\n", + state->num_groups); tevent_req_done(req); return; } @@ -143,7 +143,7 @@ NTSTATUS winbindd_getgrent_recv(struct tevent_req *req, char **memberstrings; char *result; size_t base_memberofs, total_memberlen; - int i; + uint32_t i; if (tevent_req_is_nterror(req, &status)) { TALLOC_FREE(state->cli->grent_state); @@ -206,7 +206,7 @@ NTSTATUS winbindd_getgrent_recv(struct tevent_req *req, response->extra_data.data = talloc_move(response, &result); D_NOTICE("Winbind external command GETGRENT end.\n" - "Received %d entries.\n", + "Received %u entries.\n", response->data.num_entries); return NT_STATUS_OK; -- 2.47.3