]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Change num_sids from int to uint32_t in wb_lookupusergroups_recv()
authorPavel Filipenský <pfilipen@redhat.com>
Mon, 11 Jul 2022 20:41:46 +0000 (22:41 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/wb_gettoken.c
source3/winbindd/wb_lookupusergroups.c
source3/winbindd/winbindd_proto.h

index 63c5ce816fc6e995b9c2c1f9d81769ae42f877ea..dd8f0d37e71869f621ef29e312749f9489375adb 100644 (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;
 }
index de3d184fa99b5215d8aa98f0b9f64e33ae11c8ac..3ec25b493935ad93fe2e11af9893b5003039bea7 100644 (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;
 }
index b2e33098cf91c5d28fc06ab048dd40e2450a3811..870112b3c0ffc9e840f01c57371803d84169a080 100644 (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,