i.minorperm_i386 revision b127ac411761a3d8d642d9342d9cac2785e1faaa
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# CDDL HEADER START
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# The contents of this file are subject to the terms of the
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Common Development and Distribution License (the "License").
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# You may not use this file except in compliance with the License.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# or http://www.opensolaris.org/os/licensing.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# See the License for the specific language governing permissions
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# and limitations under the License.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# fields enclosed by brackets "[]" replaced with your own identifying
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# information: Portions Copyright [yyyy] [name of copyright owner]
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# CDDL HEADER END
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Use is subject to license terms.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# NOTE: When a change is made to the source file for
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# /etc/minor_perm, a corresponding change must be made to
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# this class-action script.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# - If an existing entry in minor_perm is having its
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# attributes e.g. permissions, ownership changed,
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# add it to the list produced by make_chattr_list below.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# - If an existing entry must be deleted, add it to
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# the list produced by make_delete_list below.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# - If a new entry must be added to the file, add it to the
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# list produced by make_add_list.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# - If a new entry is being added to minor_perm, but there
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# may already be devices of that name on the system (e.g.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# we used the system default permissions in a previous release),
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# and those old devices now need to have their attributes changed,
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# add it to the make_chattr_list AND the make_add_list lists
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# If an entry in /etc/minor_perm needs to have its attributes
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# changed, identify the entry in the list copied to /etc/chattr.$$
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# by this function. The fields are:
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# <device>:<minor> <old_attrs> <new_attrs> <optional list of logical
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# devices whose attributes
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# will need to be changed>
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# where an <attribute list> := <perm> <user> <group>
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# NOTE: this list should also contain entries for nodes that previously
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# were not in /etc/minor_perm (which means the default mode of 600,
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# owner/group == root/sys), but now have an entry
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonvol:volctl 0600 root sys 0666 root sys /dev/volctl
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:llc1 0600 root sys 0666 root sys /dev/llc1
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonlog:conslog 0620 root sys 0666 root sys /dev/conslog
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonsy:tty 0666 root sys 0666 root tty /dev/tty
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonicmp:icmp 0600 root sys 0666 root sys /dev/rawip
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonicmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonip:ip 0660 root sys 0666 root sys /dev/ip
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonip6:ip6 0660 root sys 0666 root sys /dev/ip6
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonrts:rts 0660 root sys 0666 root sys /dev/rts
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonkeysock:keysock 0600 root sys 0666 root sys /dev/keysock
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonspdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonsad:admin 0600 root sys 0666 root sys /dev/sad/admin
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonfssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonfssnap:* 0600 root sys 0640 root sys /dev/fssnap/*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:dnet 0600 root sys 0666 root sys /dev/dnet
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtondnet:* 0600 root sys 0666 root sys /dev/dnet*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:elxl 0600 root sys 0666 root sys /dev/elxl
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonelxl:* 0600 root sys 0666 root sys /dev/elxl*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:iprb 0600 root sys 0666 root sys /dev/iprb
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoniprb:* 0600 root sys 0666 root sys /dev/iprb*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:pcelx 0600 root sys 0666 root sys /dev/pcelx
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonpcelx:* 0600 root sys 0666 root sys /dev/pcelx*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:spwr 0600 root sys 0666 root sys /dev/spwr
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonspwr:* 0600 root sys 0666 root sys /dev/spwr*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoncpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipf:* 0600 root sys 0666 root sys /dev/ipf
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonpfil:* 0600 root sys 0666 root sys /dev/pfil
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonscsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonfbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonlockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonprofile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonsdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonsystrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:bge 0600 root sys 0666 root sys /dev/bge
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:igb 0600 root sys 0666 root sys /dev/igb
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ixgbe 0600 root sys 0666 root sys /dev/ixgbe
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:rge 0600 root sys 0666 root sys /dev/rge
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:xge 0600 root sys 0666 root sys /dev/xge
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:nge 0600 root sys 0666 root sys /dev/nge
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:chxge 0600 root sys 0666 root sys /dev/chxge
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:pcn 0600 root sys 0666 root sys /dev/pcn
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:rtls 0600 root sys 0666 root sys /dev/rtls
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ath 0600 root sys 0666 root sys /dev/ath
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ipw 0600 root sys 0666 root sys /dev/ipw
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:iwh 0600 root sys 0666 root sys /dev/iwh
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:iwi 0600 root sys 0666 root sys /dev/iwi
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:iwk 0600 root sys 0666 root sys /dev/iwk
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:pcwl 0600 root sys 0666 root sys /dev/pcwl
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:pcan 0600 root sys 0666 root sys /dev/pcan
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ral 0600 root sys 0666 root sys /dev/ral
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:rtw 0600 root sys 0666 root sys /dev/rtw
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:rum 0600 root sys 0666 root sys /dev/rum
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ural 0600 root sys 0666 root sys /dev/ural
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:wpi 0600 root sys 0666 root sys /dev/wpi
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:afe 0600 root sys 0666 root sys /dev/afe
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:dmfe 0600 root sys 0666 root sys /dev/dmfe
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:mxfe 0600 root sys 0666 root sys /dev/mxfe
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonbge:* 0600 root sys 0666 root sys /dev/bge*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonigb:* 0600 root sys 0666 root sys /dev/igb*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonixgbe:* 0600 root sys 0666 root sys /dev/ixgbe*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonrge:* 0600 root sys 0666 root sys /dev/rge*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonxge:* 0600 root sys 0666 root sys /dev/xge*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonnge:* 0600 root sys 0666 root sys /dev/nge*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtone1000g:* 0666 root root 0666 root sys /dev/e1000g*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonchxge:* 0600 root sys 0666 root sys /dev/chxge*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonpcn:* 0600 root sys 0666 root sys /dev/pcn*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonrtls:* 0600 root sys 0666 root sys /dev/rtls*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonath:* 0600 root sys 0666 root sys /dev/ath*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipw:* 0600 root sys 0666 root sys /dev/ipw*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoniwh:* 0600 root sys 0666 root sys /dev/iwh*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoniwi:* 0600 root sys 0666 root sys /dev/iwi*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoniwk:* 0600 root sys 0666 root sys /dev/iwk*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonpcwl:* 0600 root sys 0666 root sys /dev/pcwl*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonpcan:* 0600 root sys 0666 root sys /dev/pcan*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonral:* 0600 root sys 0666 root sys /dev/ral*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonrtw:* 0600 root sys 0666 root sys /dev/rtw*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonrum:* 0600 root sys 0666 root sys /dev/rum*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonural:* 0600 root sys 0666 root sys /dev/ural*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonwpi:* 0600 root sys 0666 root sys /dev/wpi*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonafe:* 0600 root sys 0666 root sys /dev/afe*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtondmfe:* 0600 root sys 0666 root sys /dev/dmfe*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonmxfe:* 0600 root sys 0666 root sys /dev/mxfe*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonballoon:* 0600 root sys 0444 root sys /dev/xen/balloon
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtondomcaps:* 0600 root sys 0444 root sys /dev/xen/domcaps
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonevtchn:* 0600 root sys 0666 root sys /dev/xen/evtchn
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonprivcmd:* 0600 root sys 0666 root sys /dev/xen/privcmd
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonxenbus:* 0600 root sys 0666 root sys /dev/xen/xenbus
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonxpvtap:* 0600 root sys 0666 root sys /devices/xpvd/xpvtap*
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# If an entry in /etc/minor_perm needs to be deleted, identify
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# the entry in the list copied to /etc/delete.$$ by this function.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# The fields are:
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# <device>:<minor> <optional list of logical devices to be deleted>
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonclone:ipsecesp
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonprofile:profile
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# If an entry needs to be added to /etc/minor_perm, add the first
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# field of the entry to the list created by this function. The
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# remainder of the entry will be extracted from the /etc/minor_perm
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# in the package being installed, so it is not necessary to supply
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtondevinfo:devinfo
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonopeneepr:openprom
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipsecah:ipsecah
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonipsecesp:ipsecesp
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonkeysock:keysock
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonspdsock:spdsock
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtondevinfo:devinfo,ro
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtoncryptoadm:cryptoadm
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonfasttrap:fasttrap
export PATH
# Internal routine to convert an entry in a /tmp/chwhatever.$$ file to
if [ ! -f $dest ] ; then
# currently-installed /etc/minor_perm file. Also,
# /etc/minor_perm file. Also, add an entry to the
# currently-installed /etc/minor_perm file.
# the permission/ownership of devices that