s3: Fix a winbind crash when scanning trusts
authorVolker Lendecke <vl@samba.org>
Wed, 21 Apr 2010 15:04:49 +0000 (17:04 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 17 May 2010 07:50:15 +0000 (09:50 +0200)
add_trusted_domain() for a new domain always needs to be followed by a
setup_domain_child(). This was not always done, in particular not when walking
to the forest root for additional trusts.

This is a minimal patch, we need to fix add_trusted_domain().

Fix bug #7389 (Fix a winbind crash when scanning trusted domains).
(cherry picked from commit a356b04933e65aed9a6c38611bcbfce3b297d092)

source3/winbindd/winbindd_util.c

index 17603820d4f725999161a0fe52395ffc686f165b..15a357519a2930db6fee1508b7c54d5ba78fef3b 100644 (file)
@@ -422,6 +422,9 @@ static void rescan_forest_root_trusts( void )
                                                dom_list[i].dns_name,
                                                &cache_methods,
                                                &dom_list[i].sid );
+                       if (d != NULL) {
+                               setup_domain_child(d, &d->child);
+                       }
                }
 
                if (d == NULL) {
@@ -491,6 +494,9 @@ static void rescan_forest_trusts( void )
                                                        dom_list[i].dns_name,
                                                        &cache_methods,
                                                        &dom_list[i].sid );
+                               if (d != NULL) {
+                                       setup_domain_child(d, &d->child);
+                               }
                        }
 
                        if (d == NULL) {