From 810f07c5ea9d8255be30b6c10d336583bfc84a76 Mon Sep 17 00:00:00 2001 From: phaniram rampura krishnamurthy - Sun Microsystems - Bangalore India Date: Mon, 28 Jun 2010 16:45:37 +0530 Subject: 6804076 zonecfg -z global updates index file, changes global state to 'configured' --- usr/src/lib/libzonecfg/common/getzoneent.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'usr/src') diff --git a/usr/src/lib/libzonecfg/common/getzoneent.c b/usr/src/lib/libzonecfg/common/getzoneent.c index c623152933..8155f7272a 100644 --- a/usr/src/lib/libzonecfg/common/getzoneent.c +++ b/usr/src/lib/libzonecfg/common/getzoneent.c @@ -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 @@ putzoneent(struct zoneent *ze, zoneent_op_t operation) 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); -- cgit v1.2.3