--- old/usr/src/lib/libzonecfg/common/getzoneent.c	Wed Oct  5 00:33:26 2016
+++ new/usr/src/lib/libzonecfg/common/getzoneent.c	Wed Oct  5 00:33:26 2016
@@ -128,8 +128,6 @@
 			/* skip comment lines */
 			continue;
 		}
-
-		/* zonename */
 		p = gettok(&cp);
 		if (*p == '\0' || strlen(p) >= ZONENAME_MAX) {
 			/*
@@ -139,7 +137,6 @@
 		}
 		(void) strlcpy(ze->zone_name, p, ZONENAME_MAX);
 
-		/* state */
 		p = gettok(&cp);
 		if (*p == '\0') {
 			/* state field should not be empty */
@@ -156,7 +153,6 @@
 			continue;
 		}
 
-		/* zonepath */
 		p = gettok(&cp);
 		if (strlen(p) >= MAXPATHLEN) {
 			/* very long paths are not allowed */
@@ -164,35 +160,10 @@
 		}
 		(void) strlcpy(ze->zone_path, p, MAXPATHLEN);
 
-		/* uuid */
 		p = gettok(&cp);
 		if (uuid_parse(p, ze->zone_uuid) == -1)
 			uuid_clear(ze->zone_uuid);
 
-		/* brand [optional] */
-		p = gettok(&cp);
-		if (strlen(p) >= MAXNAMELEN) {
-			/* very long names are not allowed */
-			continue;
-		}
-		(void) strlcpy(ze->zone_brand, p, MAXNAMELEN);
-
-		/* IP type [optional] */
-		p = gettok(&cp);
-		if (strlen(p) >= MAXNAMELEN) {
-			/* very long names are not allowed */
-			continue;
-		}
-		ze->zone_iptype = ZS_SHARED;
-		if (*p == 'e') {
-			ze->zone_iptype = ZS_EXCLUSIVE;
-		}
-
-		/* debug ID [optional] */
-		p = gettok(&cp);
-		if (*p != '\0')
-			ze->zone_did = atoi(p);
-
 		break;
 	}
 
@@ -323,14 +294,12 @@
 	char buf[MAX_INDEX_LEN];
 	int tmp_file_desc, lock_fd, err;
 	boolean_t exist, need_quotes;
-	char *cp, *tmpp;
+	char *cp;
 	char tmp_path[MAXPATHLEN];
 	char path[MAXPATHLEN];
 	char uuidstr[UUID_PRINTABLE_STRING_LENGTH];
 	size_t namelen;
-	const char *zone_name, *zone_state, *zone_path, *zone_uuid,
-	    *zone_brand = "", *zone_iptype;
-	zoneid_t zone_did;
+	const char *zone_name, *zone_state, *zone_path, *zone_uuid;
 
 	assert(ze != NULL);
 
@@ -383,9 +352,6 @@
 	exist = B_FALSE;
 	zone_name = ze->zone_name;
 	namelen = strlen(zone_name);
-	zone_brand = ze->zone_brand;
-	zone_iptype = (ze->zone_iptype == ZS_SHARED ? "sh" : "ex");
-	zone_did = ze->zone_did;
 	for (;;) {
 		if (fgets(buf, sizeof (buf), index_file) == NULL) {
 			if (operation == PZE_ADD && !exist) {
@@ -440,11 +406,6 @@
 		}
 		zone_path = gettok(&cp);
 		zone_uuid = gettok(&cp);
-		zone_brand = gettok(&cp);
-		zone_iptype = gettok(&cp);
-		tmpp = gettok(&cp);
-		if (*tmpp != '\0')
-			zone_did = atoi(tmpp);
 
 		switch (operation) {
 		case PZE_ADD:
@@ -459,6 +420,14 @@
 			 */
 			if (ze->zone_state >= 0) {
 				zone_state = zone_state_str(ze->zone_state);
+
+				/*
+				 * If the caller is uninstalling this zone,
+				 * then wipe out the uuid.  The zone's contents
+				 * are no longer known.
+				 */
+				if (ze->zone_state < ZONE_STATE_INSTALLED)
+					zone_uuid = "";
 			}
 
 			/* If a new name is supplied, use it. */
@@ -467,27 +436,6 @@
 
 			if (ze->zone_path[0] != '\0')
 				zone_path = ze->zone_path;
-
-			/* If new UUID provided, replace it */
-			if (!uuid_is_null(ze->zone_uuid)) {
-				uuid_unparse(ze->zone_uuid, uuidstr);
-				zone_uuid = uuidstr;
-			}
-
-			/* If a brand is supplied, use it. */
-			if (ze->zone_brand[0] != '\0') {
-				zone_brand = ze->zone_brand;
-
-				/*
-				 * Since the brand, iptype and did are optional,
-				 * we we only reset the iptype and did if the
-				 * brand is provided.
-				 */
-				zone_iptype = (ze->zone_iptype == ZS_SHARED ?
-				    "sh" : "ex");
-				zone_did = ze->zone_did;
-			}
-
 			break;
 
 		case PZE_REMOVE:
@@ -519,17 +467,9 @@
 		 * method for escaping them.
 		 */
 		need_quotes = (strchr(zone_path, ':') != NULL);
-
-		if (*zone_brand != '\0') {
-			(void) fprintf(tmp_file, "%s:%s:%s%s%s:%s:%s:%s:%d\n",
-			    zone_name, zone_state, need_quotes ? "\"" : "",
-			    zone_path, need_quotes ? "\"" : "", zone_uuid,
-			    zone_brand, zone_iptype, zone_did);
-		} else {
-			(void) fprintf(tmp_file, "%s:%s:%s%s%s:%s\n", zone_name,
-			    zone_state, need_quotes ? "\"" : "", zone_path,
-			    need_quotes ? "\"" : "", zone_uuid);
-		}
+		(void) fprintf(tmp_file, "%s:%s:%s%s%s:%s\n", zone_name,
+		    zone_state, need_quotes ? "\"" : "", zone_path,
+		    need_quotes ? "\"" : "", zone_uuid);
 		exist = B_TRUE;
 	}
 
