xref: /titanic_54/usr/src/cmd/login/logindevperm.sh (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
23*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
24*7c478bd9Sstevel@tonic-gate#
25*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
26*7c478bd9Sstevel@tonic-gate#
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate# This is the script that generates the logindevperm file. It is
29*7c478bd9Sstevel@tonic-gate# architecture-aware, and dumps different stuff for x86 and sparc.
30*7c478bd9Sstevel@tonic-gate# There is a lot of common entries, which are dumped first.
31*7c478bd9Sstevel@tonic-gate#
32*7c478bd9Sstevel@tonic-gate# the SID of this script, and the SID of the dumped script are
33*7c478bd9Sstevel@tonic-gate# always the same.
34*7c478bd9Sstevel@tonic-gate#
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gatecat <<EOM
37*7c478bd9Sstevel@tonic-gate#
38*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
39*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
40*7c478bd9Sstevel@tonic-gate#
41*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%logindevperm	%I%	%E% SMI"
42*7c478bd9Sstevel@tonic-gate#
43*7c478bd9Sstevel@tonic-gate# /etc/logindevperm - login-based device permissions
44*7c478bd9Sstevel@tonic-gate#
45*7c478bd9Sstevel@tonic-gate# If the user is logging in on a device specified in the "console" field
46*7c478bd9Sstevel@tonic-gate# of any entry in this file, the owner/group of the devices listed in the
47*7c478bd9Sstevel@tonic-gate# "devices" field will be set to that of the user.  Similarly, the mode
48*7c478bd9Sstevel@tonic-gate# will be set to the mode specified in the "mode" field.
49*7c478bd9Sstevel@tonic-gate#
50*7c478bd9Sstevel@tonic-gate# "devices" is a colon-separated list of device names.  A device name
51*7c478bd9Sstevel@tonic-gate# ending in "/*", such as "/dev/fbs/*", specifies all entries (except "."
52*7c478bd9Sstevel@tonic-gate# and "..") in a directory.  A '#' begins a comment and may appear
53*7c478bd9Sstevel@tonic-gate# anywhere in an entry.
54*7c478bd9Sstevel@tonic-gate# In addition, regular expressions may be used. Refer to logindevperm(4)
55*7c478bd9Sstevel@tonic-gate# man page.
56*7c478bd9Sstevel@tonic-gate# Note that any changes in this file should be made when logged in as
57*7c478bd9Sstevel@tonic-gate# root as devfs provides persistence on minor node attributes.
58*7c478bd9Sstevel@tonic-gate#
59*7c478bd9Sstevel@tonic-gate# console	mode	devices
60*7c478bd9Sstevel@tonic-gate#
61*7c478bd9Sstevel@tonic-gate/dev/console	0600	/dev/mouse:/dev/kbd
62*7c478bd9Sstevel@tonic-gate/dev/console	0600	/dev/sound/*		# audio devices
63*7c478bd9Sstevel@tonic-gate/dev/console	0600	/dev/fbs/*		# frame buffers
64*7c478bd9Sstevel@tonic-gateEOM
65*7c478bd9Sstevel@tonic-gate
66*7c478bd9Sstevel@tonic-gatecase "$MACH" in
67*7c478bd9Sstevel@tonic-gate    "i386" )
68*7c478bd9Sstevel@tonic-gate	#
69*7c478bd9Sstevel@tonic-gate	# These are the x86 specific entries
70*7c478bd9Sstevel@tonic-gate	# It depends on the build machine being an x86
71*7c478bd9Sstevel@tonic-gate	#
72*7c478bd9Sstevel@tonic-gate	cat <<-EOM
73*7c478bd9Sstevel@tonic-gate	EOM
74*7c478bd9Sstevel@tonic-gate	;;
75*7c478bd9Sstevel@tonic-gate    "sparc" )
76*7c478bd9Sstevel@tonic-gate	#
77*7c478bd9Sstevel@tonic-gate	# These are the sparc specific entries
78*7c478bd9Sstevel@tonic-gate	# It depends on the build machine being a sparc
79*7c478bd9Sstevel@tonic-gate	#
80*7c478bd9Sstevel@tonic-gate	cat <<-EOM
81*7c478bd9Sstevel@tonic-gate	EOM
82*7c478bd9Sstevel@tonic-gate	;;
83*7c478bd9Sstevel@tonic-gate    "ppc" )
84*7c478bd9Sstevel@tonic-gate	#
85*7c478bd9Sstevel@tonic-gate	# These are the ppc specific entries
86*7c478bd9Sstevel@tonic-gate	# It depends on the build machine being a ppc
87*7c478bd9Sstevel@tonic-gate	#
88*7c478bd9Sstevel@tonic-gate	cat <<-EOM
89*7c478bd9Sstevel@tonic-gate	EOM
90*7c478bd9Sstevel@tonic-gate	;;
91*7c478bd9Sstevel@tonic-gate    * )
92*7c478bd9Sstevel@tonic-gate	echo "Unknown Architecture"
93*7c478bd9Sstevel@tonic-gate		exit 1
94*7c478bd9Sstevel@tonic-gate	;;
95*7c478bd9Sstevel@tonic-gateesac
96