6804076 zonecfg -z global updates index file, changes global state to 'configured'
authorphaniram rampura krishnamurthy - Sun Microsystems - Bangalore India <Phaniram.Krishnamurthy@Sun.COM>
Mon, 28 Jun 2010 16:45:37 +0530
changeset 12706 29969138b2f7
parent 12705 80a2ed816468
child 12707 b1f52998aafb
6804076 zonecfg -z global updates index file, changes global state to 'configured'
usr/src/lib/libzonecfg/common/getzoneent.c
--- a/usr/src/lib/libzonecfg/common/getzoneent.c	Mon Jun 28 01:11:30 2010 -0700
+++ b/usr/src/lib/libzonecfg/common/getzoneent.c	Mon Jun 28 16:45:37 2010 +0530
@@ -19,11 +19,9 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 /*
  * This module contains functions used for reading and writing the index file.
@@ -281,6 +279,16 @@
 	const char *zone_name, *zone_state, *zone_path, *zone_uuid;
 
 	assert(ze != NULL);
+
+	/*
+	 * Don't allow modification of Global Zone entry
+	 * in index file
+	 */
+	if ((operation == PZE_MODIFY) &&
+	    (strcmp(ze->zone_name, GLOBAL_ZONENAME) == 0)) {
+		return (Z_OK);
+	}
+
 	if (operation == PZE_ADD &&
 	    (ze->zone_state < 0 || strlen(ze->zone_path) == 0))
 		return (Z_INVAL);