svc-labeld revision f875b4ebb1dd9fdbeb043557cab38ab3bf7f6e01
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# CDDL HEADER START
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# The contents of this file are subject to the terms of the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Common Development and Distribution License (the "License").
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# You may not use this file except in compliance with the License.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# See the License for the specific language governing permissions
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# and limitations under the License.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# When distributing Covered Code, include this CDDL HEADER in each
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# If applicable, add the following below this CDDL HEADER, with the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# CDDL HEADER END
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Use is subject to license terms.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ident "%Z%%M% %I% %E% SMI"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: invalid syntax"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: invalid syntax: -R allowed for start method only"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: invalid -R rootpath dir specified"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: not supported in a local zone"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Comment out audio and usb device entries in /etc/logindevperm.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ -f $LOGINDEVPERM ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync sed -e "s/^$line/#$line/" $LOGINDEVPERM > /tmp/tmp.$$
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync line="\/dev\/console 0600 \/dev\/usb\/\[0-9a-f\]+\[.\]\[0-9a-f\]+\/\[0-9\]+\/\*"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync sed -e "s/^$line/#$line/" $LOGINDEVPERM > /tmp/tmp.$$
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync cat >> $ROOT_PATH/var/svc/profile/upgrade <<\__ENABLE_OTHERS
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /usr/sbin/svcadm enable -s svc:/network/tnd:default
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /usr/sbin/svcadm enable -s svc:/system/tsol-zones:default
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /usr/sbin/svccfg -s svc:/application/x11/x11-server \
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /usr/sbin/svcadm enable svc:/network/rpc/rstat:default
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Run bsmconv so audit and device allocation is enabled by
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ "$ROOT_PATH" = "/" -o "$ROOT_PATH" = "" ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# For Trusted Extensions, make nscd service transient in local zones.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynccat >> $ROOT_PATH/var/svc/profile/upgrade <<\_DEL_LOCAL_NSCD
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if /bin/svcprop -q -c -p startd/duration $nscd ; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync duration=`/bin/svcprop -c -p startd/duration $nscd`
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /usr/sbin/svccfg -s $nscd setprop stop/exec = :true
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ -f $ROOT_PATH/platform/`/sbin/uname -m`/boot_archive ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ ! -f ${ROOT_PATH}/etc/system ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync grep -v "sys_labeling=" ${ROOT_PATH}/etc/system > /tmp/etc.system.$$
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync grep "set sys_labeling=1" ${ROOT_PATH}/etc/system > /dev/null 2>&1
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ $? -ne 0 ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: ERROR: cannot set sys_labeling in $ROOT_PATH/etc/system"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # If a labeld door exists, check for a labeld process and exit
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if /usr/bin/pgrep -x -u 0 -P 1 labeld >/dev/null 2>&1; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync if [ -z "$SMF_FMRI" ]; then
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "$0: this script can only be invoked by smf(5)"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync tx_enabled=`/usr/bin/svcprop -c -p general/enabled $SMF_FMRI`
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # A sign of trying temporary enablement...no-no
f22cba796fd7499bf85058671a1af7cbe491c622vboxsync echo "$0: Temporarily enabling Trusted Extensions is not allowed."
7e032664d31552364e83b411950d6e7c96b0b880vboxsync # Make changes to enable Trusted Extensions
exit $SMF_EXIT_OK
exit $SMF_EXIT_ERR_CONFIG
exit $SMF_EXIT_OK
exit $SMF_EXIT_OK
exit $SMF_EXIT_ERR_CONFIG
# Uncomment audio and usb device entries in /etc/logindevperm.
if [ -f $LOGINDEVPERM ]; then
echo "$0: ERROR: cannot remove sys_labeling in $ROOT_PATH/etc/system"
exit $SMF_EXIT_ERR_FATAL
exit $SMF_EXIT_OK