160405de4Skz151634#! /usr/bin/sh 27c478bd9Sstevel@tonic-gate# 37c478bd9Sstevel@tonic-gate# CDDL HEADER START 47c478bd9Sstevel@tonic-gate# 57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 660405de4Skz151634# Common Development and Distribution License (the "License"). 760405de4Skz151634# You may not use this file except in compliance with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 2260405de4Skz151634# 23*ceeba6f9Srui zang - Sun Microsystems - Beijing China# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate# This is the script that generates the logindevperm file. It is 277c478bd9Sstevel@tonic-gate# architecture-aware, and dumps different stuff for x86 and sparc. 287c478bd9Sstevel@tonic-gate# There is a lot of common entries, which are dumped first. 297c478bd9Sstevel@tonic-gate# 307c478bd9Sstevel@tonic-gate# the SID of this script, and the SID of the dumped script are 317c478bd9Sstevel@tonic-gate# always the same. 327c478bd9Sstevel@tonic-gate# 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gatecat <<EOM 357c478bd9Sstevel@tonic-gate# 36*ceeba6f9Srui zang - Sun Microsystems - Beijing China# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. 377c478bd9Sstevel@tonic-gate# 387c478bd9Sstevel@tonic-gate# /etc/logindevperm - login-based device permissions 397c478bd9Sstevel@tonic-gate# 407c478bd9Sstevel@tonic-gate# If the user is logging in on a device specified in the "console" field 417c478bd9Sstevel@tonic-gate# of any entry in this file, the owner/group of the devices listed in the 427c478bd9Sstevel@tonic-gate# "devices" field will be set to that of the user. Similarly, the mode 437c478bd9Sstevel@tonic-gate# will be set to the mode specified in the "mode" field. 447c478bd9Sstevel@tonic-gate# 45*ceeba6f9Srui zang - Sun Microsystems - Beijing China# If the "console" is "/dev/vt/console_user" which is a symlink to the current 46aecfc01dSrui zang - Sun Microsystems - Beijing China# active virtual console (/dev/console, or /dev/vt/#), then the first 47aecfc01dSrui zang - Sun Microsystems - Beijing China# user to log into any virtual console will get ownership of all the 48aecfc01dSrui zang - Sun Microsystems - Beijing China# devices until they log out. 49aecfc01dSrui zang - Sun Microsystems - Beijing China# 507c478bd9Sstevel@tonic-gate# "devices" is a colon-separated list of device names. A device name 517c478bd9Sstevel@tonic-gate# ending in "/*", such as "/dev/fbs/*", specifies all entries (except "." 527c478bd9Sstevel@tonic-gate# and "..") in a directory. A '#' begins a comment and may appear 537c478bd9Sstevel@tonic-gate# anywhere in an entry. 547c478bd9Sstevel@tonic-gate# In addition, regular expressions may be used. Refer to logindevperm(4) 557c478bd9Sstevel@tonic-gate# man page. 567c478bd9Sstevel@tonic-gate# Note that any changes in this file should be made when logged in as 577c478bd9Sstevel@tonic-gate# root as devfs provides persistence on minor node attributes. 587c478bd9Sstevel@tonic-gate# 597c478bd9Sstevel@tonic-gate# console mode devices 607c478bd9Sstevel@tonic-gate# 61*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/mouse:/dev/kbd 62*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/sound/* # audio devices 63*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/fbs/* # frame buffers 64*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/dri/* # dri devices 65*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0400 /dev/removable-media/dsk/* # removable media 66*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0400 /dev/removable-media/rdsk/* # removable media 67*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0400 /dev/hotpluggable/dsk/* # hotpluggable storage 68*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0400 /dev/hotpluggable/rdsk/* # hotpluggable storage 69*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/video[0-9]+ # video devices 70*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/usb/hid[0-9]+ # hid devices should have the same permission with conskbd and consms 71*ceeba6f9Srui zang - Sun Microsystems - Beijing China/dev/vt/console_user 0600 /dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/* driver=scsa2usb,usb_mid,usbprn,ugen #libusb/ugen devices 727c478bd9Sstevel@tonic-gateEOM 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gatecase "$MACH" in 757c478bd9Sstevel@tonic-gate "i386" ) 767c478bd9Sstevel@tonic-gate # 777c478bd9Sstevel@tonic-gate # These are the x86 specific entries 787c478bd9Sstevel@tonic-gate # It depends on the build machine being an x86 797c478bd9Sstevel@tonic-gate # 807c478bd9Sstevel@tonic-gate cat <<-EOM 817c478bd9Sstevel@tonic-gate EOM 827c478bd9Sstevel@tonic-gate ;; 837c478bd9Sstevel@tonic-gate "sparc" ) 847c478bd9Sstevel@tonic-gate # 857c478bd9Sstevel@tonic-gate # These are the sparc specific entries 867c478bd9Sstevel@tonic-gate # It depends on the build machine being a sparc 877c478bd9Sstevel@tonic-gate # 887c478bd9Sstevel@tonic-gate cat <<-EOM 897c478bd9Sstevel@tonic-gate EOM 907c478bd9Sstevel@tonic-gate ;; 917c478bd9Sstevel@tonic-gate "ppc" ) 927c478bd9Sstevel@tonic-gate # 937c478bd9Sstevel@tonic-gate # These are the ppc specific entries 947c478bd9Sstevel@tonic-gate # It depends on the build machine being a ppc 957c478bd9Sstevel@tonic-gate # 967c478bd9Sstevel@tonic-gate cat <<-EOM 977c478bd9Sstevel@tonic-gate EOM 987c478bd9Sstevel@tonic-gate ;; 997c478bd9Sstevel@tonic-gate * ) 1007c478bd9Sstevel@tonic-gate echo "Unknown Architecture" 1017c478bd9Sstevel@tonic-gate exit 1 1027c478bd9Sstevel@tonic-gate ;; 1037c478bd9Sstevel@tonic-gateesac 104