]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbind: Initialize idmap in winbindd_getgroups
authorVolker Lendecke <vl@samba.org>
Fri, 12 Sep 2025 16:19:29 +0000 (18:19 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 13 Sep 2025 05:44:20 +0000 (05:44 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15914
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Sep 13 05:44:20 UTC 2025 on atb-devel-224

source3/winbindd/winbindd_getgroups.c

index 26933d9d788cb1c625eecb946416951d83078dea..2308da20ed3fc781d9c79873671d7c915f3975e2 100644 (file)
@@ -38,6 +38,7 @@ struct winbindd_getgroups_state {
        gid_t *gids;
 };
 
+static void winbindd_getgroups_idmap_initialized(struct tevent_req *subreq);
 static void winbindd_getgroups_lookupname_done(struct tevent_req *subreq);
 static void winbindd_getgroups_gettoken_done(struct tevent_req *subreq);
 static void winbindd_getgroups_sid2gid_done(struct tevent_req *subreq);
@@ -72,16 +73,40 @@ struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
+       subreq = wb_parent_idmap_setup_send(state, state->ev);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq,
+                               winbindd_getgroups_idmap_initialized,
+                               req);
+       return req;
+}
+
+static void winbindd_getgroups_idmap_initialized(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(subreq,
+                                                         struct tevent_req);
+       struct winbindd_getgroups_state *state = tevent_req_data(
+               req, struct winbindd_getgroups_state);
+       const struct wb_parent_idmap_config *cfg = NULL;
+       NTSTATUS status;
+
+       status = wb_parent_idmap_setup_recv(subreq, &cfg);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
        subreq = dcerpc_wbint_NormalizeNameUnmap_send(state,
                                                      state->ev,
                                                      idmap_child_handle(),
                                                      state->request_name,
                                                      &state->unmapped_name);
        if (tevent_req_nomem(subreq, req)) {
-               return tevent_req_post(req, ev);
+               return;
        }
        tevent_req_set_callback(subreq, winbindd_getgroups_unmap_done, req);
-       return req;
 }
 
 static void winbindd_getgroups_unmap_done(struct tevent_req *subreq)