The branch, v4-15-test has been updated
       via  ca94bad07bc s3/libads: ensure a sockaddr variable is correctly zero 
initialized
       via  a2fe8bf5a5d s3/libads: simplify storing existing ads->ldap.ss
      from  36189b0be18 s3: libsmb: Call cli_dfs_target_check() from 
cli_smb2_rename_send().

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-15-test


- Log -----------------------------------------------------------------
commit ca94bad07bc1218fa406f1629536b5f3e7295cd8
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Jan 28 17:51:10 2022 +0100

    s3/libads: ensure a sockaddr variable is correctly zero initialized
    
    is_zero_addr() doesn't work with addresses that have been zero-initialized.
    
    This fixes the logic added in c863cc2ba34025731a18ac735f714b5b888504da.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14674
    MR: https://gitlab.com/samba-team/samba/-/merge_requests/2354
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Tue Feb  8 20:24:12 UTC 2022 on sn-devel-184
    
    (cherry picked from commit 3ee690455eb963dedc7955b79316481387d4ac8c)
    
    Autobuild-User(v4-15-test): Jule Anger <jan...@samba.org>
    Autobuild-Date(v4-15-test): Wed Feb  9 12:35:08 UTC 2022 on sn-devel-184

commit a2fe8bf5a5d0889dc53697904fd647812dc74c8c
Author: Ralph Boehme <s...@samba.org>
Date:   Mon Jan 31 12:54:12 2022 +0100

    s3/libads: simplify storing existing ads->ldap.ss
    
    We just need temporal storage for ads->ldap.ss, no need to store it as a 
struct
    samba_sockaddr.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14674
    MR: https://gitlab.com/samba-team/samba/-/merge_requests/2354
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    (cherry picked from commit c266ed40aeb1b1f59a1811cd4511e32e44a4a719)

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

Summary of changes:
 source3/libads/ldap.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 1bc271785e2..647cdbd0459 100755
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -605,7 +605,9 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
        ADS_STATUS status;
        NTSTATUS ntstatus;
        char addr[INET6_ADDRSTRLEN];
-       struct samba_sockaddr existing_sa = {0};
+       struct sockaddr_storage existing_ss;
+
+       zero_sockaddr(&existing_ss);
 
        /*
         * ads_connect can be passed in a reused ADS_STRUCT
@@ -627,11 +629,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
         */
        if (ads->server.ldap_server == NULL && !is_zero_addr(&ads->ldap.ss)) {
                /* Save off the address we previously found by ads_find_dc(). */
-               bool ok = sockaddr_storage_to_samba_sockaddr(&existing_sa,
-                                                            &ads->ldap.ss);
-               if (!ok) {
-                       return ADS_ERROR_NT(NT_STATUS_INVALID_ADDRESS);
-               }
+               existing_ss = ads->ldap.ss;
        }
 
        ads_zero_ldap(ads);
@@ -679,11 +677,11 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
                }
        }
 
-       if (!is_zero_addr(&existing_sa.u.ss)) {
+       if (!is_zero_addr(&existing_ss)) {
                /* We saved off who we should talk to. */
                bool ok = ads_try_connect(ads,
                                          ads->server.gc,
-                                         &existing_sa.u.ss);
+                                         &existing_ss);
                if (ok) {
                        goto got_connection;
                }


-- 
Samba Shared Repository

Reply via email to