#!/bin/ksh
#
# ident "txguard.ksh 2007-06-04 $ $Revision: $ SMI"
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#
# Exit with an error message in case it will be executed 
# from within a non-global zone on Solaris 10 Trusted 
# Extensions system. Program name will be determined by
# evaluating $0.
#
# Returns:
# Nothing if not executed in a non-global zone on Solaris
# 10 Trusted Extensions otherwise doesn't return but exit 
# with 1.
#

PROG_NAME=$0
PROG_NAME=${PROG_NAME:-"This program"}
PROG_NAME=${PROG_NAME##*/}

if [ -x /bin/plabel ] && /bin/plabel > /dev/null 2>&1 && \
	[ "$(/bin/zonename 2> /dev/null)" != "global" ]
then
	print -u2 $PROG_NAME can only be run from the global zone.
	exit 1
fi

