entry in winbindd_cache.tdb gets overwritten if child domain names in 2 different forests are same

Shilpa K shilpa.krishnareddy at gmail.com
Tue May 4 05:19:14 UTC 2021


We had a setup where child domains in 2 different forests had the same
names. In this case, we noticed that the child domain name of one forest in
trusted domain cache  (TRUSTDOMCACHE/<domainname>) gets overwritten with
the child domain name of another forest.

Attached patch helped us. Could you please let me know if it is applicable
to master as well?


index 4a366ee6ff8..c074ea80862 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -4199,7 +4199,8 @@ static bool add_wbdomain_to_tdc_array( struct
winbindd_domain *new_dom,
        list = *domains;

        for ( i=0; i< (*num_domains); i++ ) {
-               if ( strequal( new_dom->name, list[i].domain_name ) ) {
+               if ( strequal( new_dom->name, list[i].domain_name ) &&
+                    strequal( new_dom->alt_name, list[i].dns_name) ) {
                        DEBUG(10,("add_wbdomain_to_tdc_array: Found
existing record for %s\n",
                        idx = i;

More information about the samba-technical mailing list