svc-labeld revision 269f47de02761bab3b7b28e2007a2bac34f629cc
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# CDDL HEADER START
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# The contents of this file are subject to the terms of the
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# Common Development and Distribution License (the "License").
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# You may not use this file except in compliance with the License.
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# See the License for the specific language governing permissions
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# and limitations under the License.
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# When distributing Covered Code, include this CDDL HEADER in each
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# If applicable, add the following below this CDDL HEADER, with the
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# fields enclosed by brackets "[]" replaced with your own identifying
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# information: Portions Copyright [yyyy] [name of copyright owner]
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# CDDL HEADER END
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose echo "$0: invalid syntax"
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose echo "$0: invalid syntax: -R allowed for start method only"
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose echo "$0: invalid -R rootpath dir specified"
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose echo "$0: not supported in a local zone"
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose # Comment out audio, usb, removable-media, and hotpluggable device
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ ! -f $LOGINDEVPERM ]; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose sed -e "s!^$from\([^# ]\{1,\}[ }\{1,\}[0-9]\{1,\}[ ]\{1,\}\)$line!$to\1$line!" \
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose cat >> $ROOT_PATH/var/svc/profile/upgrade <<\__ENABLE_OTHERS
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svcadm enable -s svc:/network/tnd:default
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svcadm enable -s svc:/system/tsol-zones:default
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svcadm enable svc:/network/rpc/rstat:default
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose # Ensure auditing and device allocation are enabled by
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ "$ROOT_PATH" = "/" -o "$ROOT_PATH" = "" ]; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svcadm enable -s svc:/system/device/allocate:default
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose cat >> $ROOT_PATH/var/svc/profile/upgrade <<\_ENABLE_AUDITD
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svcadm enable -s svc:/system/device/allocate:default
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# For Trusted Extensions, make nscd service transient in local zones.
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosecat >> $ROOT_PATH/var/svc/profile/upgrade <<\_DEL_LOCAL_NSCD
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if /bin/svcprop -q -c -p startd/duration $nscd ; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose duration=`/bin/svcprop -c -p startd/duration $nscd`
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose /usr/sbin/svccfg -s $nscd setprop stop/exec = :true
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ -f $ROOT_PATH/platform/`/sbin/uname -m`/boot_archive ]; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ -z "$ROOT_PATH" -o "$ROOT_PATH" = "/" ]; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose# No comments or blanks lines allowed in entries below
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtlogin account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtlogin account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtsession account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtsession account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosegdm account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosegdm account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosexscreensaver account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosexscreensaver account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosepasswd account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosepasswd account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtpasswd account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosedtpasswd account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosetsoljds-tstripe account requisite pam_roles.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bosetsoljds-tstripe account required pam_unix_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Boseother account required pam_tsol_account.so.1
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ ! -f ${PAM_DEST} ]; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose # Update pam.conf to append Trusted Extensions entries if not
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose while read e1 e2 e3 e4 e5
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose # If this is the 'other' entry, add it unless it already
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ $? = 1 ] ; then
1d1a0a019d8d4d9ab0f51ada03604cd2cada287eSumit Bose if [ $? = 1 ] ; then
done < ${TX_ENTRIES}
mkdir $PAM_TMP || exit $SMF_EXIT_ERR_FATAL
if [ ! -f ${PAM_DEST} ]; then
exit $SMF_EXIT_ERR_FATAL
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
exit $SMF_EXIT_ERR_FATAL
ROOTDIR=$1
-e $SOL_VERS -t $TX_PROD_URN -P Solaris $SOL_PROD_URN \
exit $SMF_EXIT_ERR_FATAL
if [ -z "$SMF_FMRI" ]; then
exit $SMF_EXIT_ERR_NOSMF
# A sign of trying temporary enablement...no-no
exit $SMF_EXIT_ERR_CONFIG
if (smf_is_system_labeled); then
exit $SMF_EXIT_OK
exit $SMF_EXIT_OK
exit $SMF_EXIT_ERR_CONFIG
exit $SMF_EXIT_OK
exit $SMF_EXIT_OK
exit $SMF_EXIT_ERR_CONFIG
# entries in /etc/logindevperm.
echo "$0: ERROR: cannot remove sys_labeling in $ROOT_PATH/etc/system"
exit $SMF_EXIT_ERR_FATAL
exit $SMF_EXIT_OK