be a bit more paranoid about not getting duplicate domain names (can
authorAndrew Tridgell <tridge@samba.org>
Sun, 18 Aug 2002 15:46:03 +0000 (15:46 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 18 Aug 2002 15:46:03 +0000 (15:46 +0000)
happen when the LDAP call to get the flatname for the primary domain
fails)
(This used to be commit 8d40f34e2f5188f15f414e807d023bfea7bd8c8e)

source3/nsswitch/winbindd_util.c

index daa3abb3400529179ca1fdb3f21b462df6c15bea..2016c27881ddf369a229c0fd5ff8915ad23548e0 100644 (file)
@@ -83,10 +83,16 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
        /* We can't call domain_list() as this function is called from
           init_domain_list() and we'll get stuck in a loop. */
        for (domain = _domain_list; domain; domain = domain->next) {
-               if (strcmp(domain_name, domain->name) == 0 ||
-                   strcmp(domain_name, domain->alt_name) == 0) {
+               if (strcasecmp(domain_name, domain->name) == 0 ||
+                   strcasecmp(domain_name, domain->alt_name) == 0) {
                        return domain;
                }
+               if (alt_name && *alt_name) {
+                       if (strcasecmp(alt_name, domain->name) == 0 ||
+                           strcasecmp(alt_name, domain->alt_name) == 0) {
+                               return domain;
+                       }
+               }
        }
         
        /* Create new domain entry */