8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / tsol / tsol-zones / svc-tsol-zones
bloba657bf3a0cb0be79a2f00c8fc59d894223e38ac6
1 #!/sbin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
22 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
26 # This is a transient service for Trusted Extensions to perform miscellaneous
27 # set-up in a labeled zone. It can be extended to disable any selected
28 # services so they will not be started in zones.
31 . /lib/svc/share/smf_include.sh
34 # Add pam entries for labeling.
35 do_addpam()
37 pamconf=/etc/pam.conf
39 grep '^[ ]*other.*account.*pam_tsol_account' $pamconf \
40 > /dev/null 2>&1
41 if [ $? -ne 0 ] ; then
42 # Append new entry
43 cat >> $pamconf << EOF
44 other account required pam_tsol_account.so.1
45 EOF
50 # In the global zone, there's nothing to do so this service exits.
51 if smf_is_globalzone; then
52 /usr/sbin/svcadm disable $SMF_FMRI
53 exit $SMF_EXIT_OK
57 # Exit if Trusted Extensions is not enabled.
58 smf_is_system_labeled || exit $SMF_EXIT_OK
61 # Add pam entries for the labeled zone.
62 do_addpam
65 # Disable any services here (remember to add dependencies to the
66 # tsol-zones XML manifest) ...
69 exit $SMF_EXIT_OK