]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbindd: split out wb_gettoken_trylocalgroups() function
authorStefan Metzmacher <metze@samba.org>
Sat, 23 Jul 2022 22:44:07 +0000 (00:44 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 15 Jan 2025 13:03:34 +0000 (13:03 +0000)
This makes the logical steps a bit cleaner and future changes easier.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/wb_gettoken.c

index 3930f71d98d83e03f735b83dbdc87e7e59f99705..5e2d21f23be069da78bc36d17b73564a85be3990 100644 (file)
@@ -40,6 +40,7 @@ static NTSTATUS wb_add_rids_to_sids(TALLOC_CTX *mem_ctx,
 
 static void wb_gettoken_gotuser(struct tevent_req *subreq);
 static void wb_gettoken_gotgroups(struct tevent_req *subreq);
+static void wb_gettoken_trylocalgroups(struct tevent_req *req);
 static void wb_gettoken_gotlocalgroups(struct tevent_req *subreq);
 static void wb_gettoken_gotbuiltins(struct tevent_req *subreq);
 
@@ -116,7 +117,6 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
                req, struct wb_gettoken_state);
        uint32_t i, num_groups;
        struct dom_sid *groups;
-       struct winbindd_domain *domain;
        NTSTATUS status;
        struct dom_sid_buf buf;
 
@@ -138,6 +138,16 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
                }
        }
 
+       wb_gettoken_trylocalgroups(req);
+}
+
+static void wb_gettoken_trylocalgroups(struct tevent_req *req)
+{
+       struct wb_gettoken_state *state = tevent_req_data(
+               req, struct wb_gettoken_state);
+       struct winbindd_domain *domain = NULL;
+       struct tevent_req *subreq = NULL;
+
        if (!state->expand_local_aliases) {
                D_DEBUG("Done. Not asked to expand local aliases.\n");
                tevent_req_done(req);