The branch, master has been updated
       via  7d255e5c233 lib/addns: match additional names in a non case 
insensitive way
       via  628d7b6f2e6 s3:rpc_client: pass remote_{name,sockaddr} to 
rpccli_setup_netlogon_creds[_locked]()
       via  c3222192a40 s3:rpc_client: add missing TALLOC_FREE(frame) in 
cli_rpc_pipe_open()
      from  03e880931d0 doc: Update doc about talloc vs malloc speed

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


- Log -----------------------------------------------------------------
commit 7d255e5c233237041228544b19114bd1f93c2468
Author: Stefan Metzmacher <me...@samba.org>
Date:   Thu Sep 26 14:47:26 2024 +0200

    lib/addns: match additional names in a non case insensitive way
    
    Sometime proxy dns servers mess up the case of parts of the
    name...
    
    So we should match with strequal() instead of strcmp(),
    which results in much less dns packets on the wire...
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>
    
    Autobuild-User(master): Volker Lendecke <v...@samba.org>
    Autobuild-Date(master): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224

commit 628d7b6f2e626c9c530473d06c038dfec9cbd17a
Author: Stefan Metzmacher <me...@samba.org>
Date:   Fri Sep 27 09:38:19 2024 +0200

    s3:rpc_client: pass remote_{name,sockaddr} to 
rpccli_setup_netlogon_creds[_locked]()
    
    We shouldd not rely on cli_state to be a valid pointer
    (at least not when NCACN_IP_TCP is used...)
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit c3222192a40a2b1608c9c48f0352cb6f18f26d79
Author: Stefan Metzmacher <me...@samba.org>
Date:   Fri Sep 27 12:00:59 2024 +0200

    s3:rpc_client: add missing TALLOC_FREE(frame) in cli_rpc_pipe_open()
    
    This was missing in commit 637a8e5270fefaea5c61921d4b6ecfc4455a91aa.
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

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

Summary of changes:
 lib/addns/dnsquery.c                   |  6 +++++-
 source3/rpc_client/cli_netlogon.c      | 13 ++++++++-----
 source3/rpc_client/cli_netlogon.h      |  2 ++
 source3/rpc_client/cli_pipe.c          |  1 +
 source3/rpc_client/cli_pipe_schannel.c |  5 ++++-
 source3/rpcclient/rpcclient.c          |  2 ++
 6 files changed, 22 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/addns/dnsquery.c b/lib/addns/dnsquery.c
index 7590c9ff508..c997077bb53 100644
--- a/lib/addns/dnsquery.c
+++ b/lib/addns/dnsquery.c
@@ -151,7 +151,11 @@ static void ads_dns_lookup_srv_done(struct tevent_req 
*subreq)
                        struct dns_rr_srv *srv = &state->srvs[j];
                        struct sockaddr_storage *tmp;
 
-                       if (strcmp(srv->hostname, ar->name) != 0) {
+                       /*
+                        * sometimes the name gets messed up
+                        * with upper and lower case...
+                        */
+                       if (!strequal(srv->hostname, ar->name)) {
                                continue;
                        }
                        /* uint16_t can't wrap here. */
diff --git a/source3/rpc_client/cli_netlogon.c 
b/source3/rpc_client/cli_netlogon.c
index 7f0ab7c82ed..fe28e2669a2 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -156,6 +156,8 @@ NTSTATUS rpccli_create_netlogon_creds_ctx(
 static NTSTATUS rpccli_setup_netlogon_creds_locked(
        struct cli_state *cli,
        enum dcerpc_transport_t transport,
+       const char *remote_name,
+       const struct sockaddr_storage *remote_sockaddr,
        struct netlogon_creds_cli_context *creds_ctx,
        bool force_reauth,
        struct cli_credentials *cli_creds,
@@ -170,8 +172,6 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked(
        const struct samr_Password *nt_hashes[2] = { NULL, NULL };
        uint8_t idx_nt_hashes = 0;
        NTSTATUS status;
-       const char *remote_name = NULL;
-       const struct sockaddr_storage *remote_sockaddr = NULL;
 
        status = netlogon_creds_cli_get(creds_ctx, frame, &creds);
        if (NT_STATUS_IS_OK(status)) {
@@ -210,9 +210,6 @@ static NTSTATUS rpccli_setup_netlogon_creds_locked(
                num_nt_hashes = 2;
        }
 
-       remote_name = smbXcli_conn_remote_name(cli->conn);
-       remote_sockaddr = smbXcli_conn_remote_sockaddr(cli->conn);
-
        status = cli_rpc_pipe_open_noauth_transport(cli,
                                                    transport,
                                                    &ndr_table_netlogon,
@@ -266,6 +263,8 @@ done:
 NTSTATUS rpccli_setup_netlogon_creds(
        struct cli_state *cli,
        enum dcerpc_transport_t transport,
+       const char *remote_name,
+       const struct sockaddr_storage *remote_sockaddr,
        struct netlogon_creds_cli_context *creds_ctx,
        bool force_reauth,
        struct cli_credentials *cli_creds)
@@ -286,6 +285,8 @@ NTSTATUS rpccli_setup_netlogon_creds(
 
        status = rpccli_setup_netlogon_creds_locked(cli,
                                                    transport,
+                                                   remote_name,
+                                                   remote_sockaddr,
                                                    creds_ctx,
                                                    force_reauth,
                                                    cli_creds,
@@ -418,6 +419,8 @@ again:
 
        status = rpccli_setup_netlogon_creds_locked(cli,
                                                    transport,
+                                                   remote_name,
+                                                   remote_sockaddr,
                                                    creds_ctx,
                                                    true,
                                                    trust_creds,
diff --git a/source3/rpc_client/cli_netlogon.h 
b/source3/rpc_client/cli_netlogon.h
index ce37d12318a..82c88b14130 100644
--- a/source3/rpc_client/cli_netlogon.h
+++ b/source3/rpc_client/cli_netlogon.h
@@ -42,6 +42,8 @@ NTSTATUS rpccli_create_netlogon_creds_ctx(
 NTSTATUS rpccli_setup_netlogon_creds(
        struct cli_state *cli,
        enum dcerpc_transport_t transport,
+       const char *remote_name,
+       const struct sockaddr_storage *remote_sockaddr,
        struct netlogon_creds_cli_context *creds_ctx,
        bool force_reauth,
        struct cli_credentials *cli_creds);
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index e231d5875a5..d512dde386f 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3983,6 +3983,7 @@ static NTSTATUS cli_rpc_pipe_open(struct cli_state *cli,
                                               table,
                                               &port);
                if (!NT_STATUS_IS_OK(status)) {
+                       TALLOC_FREE(frame);
                        return status;
                }
 
diff --git a/source3/rpc_client/cli_pipe_schannel.c 
b/source3/rpc_client/cli_pipe_schannel.c
index abfdd8d5b5a..a8f8bf4cef4 100644
--- a/source3/rpc_client/cli_pipe_schannel.c
+++ b/source3/rpc_client/cli_pipe_schannel.c
@@ -89,7 +89,10 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
                goto done;
        }
 
-       status = rpccli_setup_netlogon_creds(cli, transport,
+       status = rpccli_setup_netlogon_creds(cli,
+                                            transport,
+                                            remote_name,
+                                            remote_sockaddr,
                                             netlogon_creds,
                                             false, /* force_reauth */
                                             cli_creds);
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 95b6baf32b0..c08a75d4359 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -1035,6 +1035,8 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                                ntresult = rpccli_setup_netlogon_creds(
                                        cli,
                                        NCACN_NP,
+                                       remote_name,
+                                       remote_sockaddr,
                                        rpcclient_netlogon_creds,
                                        false, /* force_reauth */
                                        trust_creds);


-- 
Samba Shared Repository

Reply via email to