6930152 6192139 (no reboot audit -- PSARC/2009/354) points out less than optimal...
[unleashed.git] / usr / src / cmd / login / logindevperm.sh
blob1af5656896967adb70f60cce7236ed368bfb1c37
1 #! /usr/bin/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
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
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.
31 # the SID of this script, and the SID of the dumped script are
32 # always the same.
35 cat <<EOM
37 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
38 # Use is subject to license terms.
40 # /etc/logindevperm - login-based device permissions
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.
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.
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.
61 # console mode devices
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
86 EOM
88 case "$MACH" in
89 "i386" )
91 # These are the x86 specific entries
92 # It depends on the build machine being an x86
94 cat <<-EOM
95 EOM
97 "sparc" )
99 # These are the sparc specific entries
100 # It depends on the build machine being a sparc
102 cat <<-EOM
105 "ppc" )
107 # These are the ppc specific entries
108 # It depends on the build machine being a ppc
110 cat <<-EOM
114 echo "Unknown Architecture"
115 exit 1
117 esac