changeset 10749:b871274b236d

6888504 idmapd core dump in reload_dcs()
author Jordan Brown <Jordan.Brown@Sun.COM>
date Fri, 09 Oct 2009 08:01:39 -0700
parents 9a5bce5b2c2f
children 9168799eeedc
files usr/src/cmd/idmap/idmapd/init.c
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/idmap/idmapd/init.c	Fri Oct 09 11:01:45 2009 +0200
+++ b/usr/src/cmd/idmap/idmapd/init.c	Fri Oct 09 08:01:39 2009 -0700
@@ -277,14 +277,21 @@
 			goto nomem;
 	}
 
-	/* NEEDSWORK:  isn't there an easier way to find the domain SID? */
-	for (i = 0; pgcfg->domains_in_forest[i].domain[0] != '\0'; i++) {
-		if (domain_eq(pgcfg->domain_name,
-		    pgcfg->domains_in_forest[i].domain)) {
-			if (adutils_add_domain(new_dcs[0], pgcfg->domain_name,
-			    pgcfg->domains_in_forest[i].sid) != 0)
-				goto nomem;
-			break;
+	/*
+	 * NEEDSWORK:  All we need here is to add the domain and SID for
+	 * this DC to the list of domains supported by this entry.  Isn't
+	 * there an easier way to find the SID than to walk through the list
+	 * of all of the domains in the forest?
+	 */
+	ad_disc_domainsinforest_t *dif = pgcfg->domains_in_forest;
+	if (dif != NULL) {
+		for (; dif->domain[0] != '\0'; dif++) {
+			if (domain_eq(pgcfg->domain_name, dif->domain)) {
+				if (adutils_add_domain(new_dcs[0],
+				    dif->domain, dif->sid) != 0)
+					goto nomem;
+				break;
+			}
 		}
 	}