]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Change max_users, num_users from int to uint32_t in winbindd_getpwent_state
authorPavel Filipenský <pfilipen@redhat.com>
Thu, 14 Jul 2022 11:19:44 +0000 (13:19 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 15:21:23 +0000 (15:21 +0000)
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 15 15:21:23 UTC 2022 on sn-devel-184

source3/winbindd/winbindd_getpwent.c

index b5cc5bb5a1d2f84959a0a7b1647684d206ab62a1..3e2976485d9f8217a1dad45ab30d447435baf7c1 100644 (file)
@@ -23,8 +23,8 @@
 struct winbindd_getpwent_state {
        struct tevent_context *ev;
        struct winbindd_cli_state *cli;
-       int max_users;
-       int num_users;
+       uint32_t max_users;
+       uint32_t num_users;
        struct winbindd_pw *users;
 };
 
@@ -91,8 +91,8 @@ static void winbindd_getpwent_done(struct tevent_req *subreq)
        status = wb_next_pwent_recv(subreq);
        TALLOC_FREE(subreq);
        if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) {
-               D_DEBUG("winbindd_getpwent_done: done with %d users\n",
-                          (int)state->num_users);
+               D_DEBUG("winbindd_getpwent_done: done with %u users\n",
+                       state->num_users);
                TALLOC_FREE(state->cli->pwent_state);
                tevent_req_done(req);
                return;
@@ -102,8 +102,8 @@ static void winbindd_getpwent_done(struct tevent_req *subreq)
        }
        state->num_users += 1;
        if (state->num_users >= state->max_users) {
-               D_DEBUG("winbindd_getpwent_done: Got enough users: %d\n",
-                          (int)state->num_users);
+               D_DEBUG("winbindd_getpwent_done: Got enough users: %u\n",
+                       state->num_users);
                tevent_req_done(req);
                return;
        }
@@ -126,7 +126,7 @@ NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
        struct winbindd_getpwent_state *state = tevent_req_data(
                req, struct winbindd_getpwent_state);
        NTSTATUS status;
-       int i;
+       uint32_t i;
 
        if (tevent_req_is_nterror(req, &status)) {
                TALLOC_FREE(state->cli->pwent_state);
@@ -144,7 +144,7 @@ NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
        }
 
        for (i = 0; i < state->num_users; i++) {
-               D_NOTICE("%d: %s:%s:%u:%u:%s:%s:%s\n",
+               D_NOTICE("%u: %s:%s:%u:%u:%s:%s:%s\n",
                        i,
                        state->users[i].pw_name,
                        state->users[i].pw_passwd,