The branch, master has been updated
       via  0c4b632310b s3:winbind: Initialize and setup idmap child in 
winbindd_getgrnam()
       via  96ff0669806 s3:winbind: Initialize and setup idmap child in 
winbindd_getpwnam()
      from  96870782516 smbd: avoid mangling names in 
smbd_dirptr_lanman2_match_fn() for POSIX

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0c4b632310b6e946d8493735b8cdeeb0d2cc39fe
Author: Samuel Cabrero <[email protected]>
Date:   Mon Jul 7 13:15:43 2025 +0200

    s3:winbind: Initialize and setup idmap child in winbindd_getgrnam()
    
    Make sure the idmap child is initialized before delegating the name 
unmapping.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15882
    
    Signed-off-by: Samuel Cabrero <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>
    
    Autobuild-User(master): Samuel Cabrero <[email protected]>
    Autobuild-Date(master): Tue Jul  8 07:21:26 UTC 2025 on atb-devel-224

commit 96ff066980649c5a7ec549983232a574d437eb71
Author: Samuel Cabrero <[email protected]>
Date:   Mon Jul 7 13:04:15 2025 +0200

    s3:winbind: Initialize and setup idmap child in winbindd_getpwnam()
    
    Make sure the idmap child is initialized before delegating the name 
unmapping.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15882
    
    Signed-off-by: Samuel Cabrero <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/winbindd_getgrnam.c | 29 ++++++++++++++++++++++++++---
 source3/winbindd/winbindd_getpwnam.c | 33 ++++++++++++++++++++++++++++-----
 2 files changed, 54 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_getgrnam.c 
b/source3/winbindd/winbindd_getgrnam.c
index be19287c15b..0ea5f00a605 100644
--- a/source3/winbindd/winbindd_getgrnam.c
+++ b/source3/winbindd/winbindd_getgrnam.c
@@ -39,7 +39,7 @@ struct winbindd_getgrnam_state {
        struct db_context *members;
 };
 
-static void winbindd_getgrnam_unmap_done(struct tevent_req *subreq);
+static void winbindd_getgrnam_initialized(struct tevent_req *subreq);
 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
                                          struct winbindd_cli_state *cli,
@@ -69,16 +69,39 @@ struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX 
*mem_ctx,
                return tevent_req_post(req, ev);
        }
 
+       subreq = wb_parent_idmap_setup_send(state, ev);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, winbindd_getgrnam_initialized, req);
+       return req;
+}
+
+static void winbindd_getgrnam_unmap_done(struct tevent_req *subreq);
+static void winbindd_getgrnam_initialized(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(subreq,
+                                                         struct tevent_req);
+       struct winbindd_getgrnam_state *state = tevent_req_data(
+               req, struct winbindd_getgrnam_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_getgrnam_unmap_done, req);
-       return req;
 }
 
 static void winbindd_getgrnam_lookupname_done(struct tevent_req *subreq);
diff --git a/source3/winbindd/winbindd_getpwnam.c 
b/source3/winbindd/winbindd_getpwnam.c
index f22b724ab66..b286176dcb0 100644
--- a/source3/winbindd/winbindd_getpwnam.c
+++ b/source3/winbindd/winbindd_getpwnam.c
@@ -38,7 +38,7 @@ struct winbindd_getpwnam_state {
 static void winbindd_getpwnam_lookupname_done(struct tevent_req *subreq);
 static void winbindd_getpwnam_done(struct tevent_req *subreq);
 
-static void winbindd_getgrnam_unmap_done(struct tevent_req *subreq);
+static void winbindd_getpwnam_initialized(struct tevent_req *subreq);
 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
                                          struct winbindd_cli_state *cli,
@@ -68,19 +68,42 @@ struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX 
*mem_ctx,
                return tevent_req_post(req, ev);
        }
 
+       subreq = wb_parent_idmap_setup_send(state, ev);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, winbindd_getpwnam_initialized, req);
+       return req;
+}
+
+static void winbindd_getpwnam_unmap_done(struct tevent_req *subreq);
+static void winbindd_getpwnam_initialized(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(subreq,
+                                                         struct tevent_req);
+       struct winbindd_getpwnam_state *state = tevent_req_data(
+               req, struct winbindd_getpwnam_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_getgrnam_unmap_done, req);
-       return req;
+       tevent_req_set_callback(subreq, winbindd_getpwnam_unmap_done, req);
 }
 
-static void winbindd_getgrnam_unmap_done(struct tevent_req *subreq)
+static void winbindd_getpwnam_unmap_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(subreq,
                                                          struct tevent_req);


-- 
Samba Shared Repository

Reply via email to