xref: /titanic_41/usr/src/cmd/login/logindevperm.sh (revision bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2eb)
1#! /usr/bin/sh
2#
3# CDDL HEADER START
4#
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.
8#
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.
13#
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]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27# This is the script that generates the logindevperm file. It is
28# architecture-aware, and dumps different stuff for x86 and sparc.
29# There is a lot of common entries, which are dumped first.
30#
31# the SID of this script, and the SID of the dumped script are
32# always the same.
33#
34
35cat <<EOM
36#
37# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
38# Use is subject to license terms.
39#
40# /etc/logindevperm - login-based device permissions
41#
42# If the user is logging in on a device specified in the "console" field
43# of any entry in this file, the owner/group of the devices listed in the
44# "devices" field will be set to that of the user.  Similarly, the mode
45# will be set to the mode specified in the "mode" field.
46#
47# If the "console" is "/dev/vt/active" which is a symlink to the current
48# active virtual console (/dev/console, or /dev/vt/#), then the first
49# user to log into any virtual console will get ownership of all the
50# devices until they log out.
51#
52# "devices" is a colon-separated list of device names.  A device name
53# ending in "/*", such as "/dev/fbs/*", specifies all entries (except "."
54# and "..") in a directory.  A '#' begins a comment and may appear
55# anywhere in an entry.
56# In addition, regular expressions may be used. Refer to logindevperm(4)
57# man page.
58# Note that any changes in this file should be made when logged in as
59# root as devfs provides persistence on minor node attributes.
60#
61# console	mode	devices
62#
63/dev/console	0600	/dev/mouse:/dev/kbd
64/dev/console	0600	/dev/kdmouse		# mouse devices
65/dev/console	0600	/dev/sound/*		# audio devices
66/dev/console	0600	/dev/fbs/*		# frame buffers
67/dev/console	0600	/dev/dri/*		# dri devices
68/dev/console	0400	/dev/removable-media/dsk/*	# removable media
69/dev/console	0400	/dev/removable-media/rdsk/*	# removable media
70/dev/console	0400	/dev/hotpluggable/dsk/*		# hotpluggable storage
71/dev/console	0400	/dev/hotpluggable/rdsk/*	# hotpluggable storage
72/dev/console	0600	/dev/video[0-9]+	# video devices
73/dev/console	0600	/dev/usb/hid[0-9]+	# hid devices should have the same permission with conskbd and consms
74/dev/console	0600	/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/* driver=scsa2usb,usb_mid,usbprn,ugen	#libusb/ugen devices
75/dev/vt/active	0600	/dev/mouse:/dev/kbd
76/dev/vt/active	0600	/dev/sound/*		# audio devices
77/dev/vt/active	0600	/dev/fbs/*		# frame buffers
78/dev/vt/active	0600	/dev/dri/*		# dri devices
79/dev/vt/active	0400	/dev/removable-media/dsk/*	# removable media
80/dev/vt/active	0400	/dev/removable-media/rdsk/*	# removable media
81/dev/vt/active	0400	/dev/hotpluggable/dsk/*		# hotpluggable storage
82/dev/vt/active	0400	/dev/hotpluggable/rdsk/*	# hotpluggable storage
83/dev/vt/active	0600	/dev/video[0-9]+	# video devices
84/dev/vt/active	0600	/dev/usb/hid[0-9]+	# hid devices should have the same permission with conskbd and consms
85/dev/vt/active	0600	/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/* driver=scsa2usb,usb_mid,usbprn,ugen	#libusb/ugen devices
86EOM
87
88case "$MACH" in
89    "i386" )
90	#
91	# These are the x86 specific entries
92	# It depends on the build machine being an x86
93	#
94	cat <<-EOM
95	EOM
96	;;
97    "sparc" )
98	#
99	# These are the sparc specific entries
100	# It depends on the build machine being a sparc
101	#
102	cat <<-EOM
103	EOM
104	;;
105    "ppc" )
106	#
107	# These are the ppc specific entries
108	# It depends on the build machine being a ppc
109	#
110	cat <<-EOM
111	EOM
112	;;
113    * )
114	echo "Unknown Architecture"
115		exit 1
116	;;
117esac
118