i.minorperm_i386 revision 4bff34e37def8a90f9194d81bc345c52ba20086a
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# CDDL HEADER START
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# The contents of this file are subject to the terms of the
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawick# Common Development and Distribution License (the "License").
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawick# You may not use this file except in compliance with the License.
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# See the License for the specific language governing permissions
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# and limitations under the License.
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# When distributing Covered Code, include this CDDL HEADER in each
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# If applicable, add the following below this CDDL HEADER, with the
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# fields enclosed by brackets "[]" replaced with your own identifying
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# information: Portions Copyright [yyyy] [name of copyright owner]
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manoj# CDDL HEADER END
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard# Use is subject to license terms.
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard#ident "%Z%%M% %I% %E% SMI"
10b386767f6c87b45937244371cb751f0b454d16wrowe# NOTE: When a change is made to the source file for
75960f20f88dad6bc67892c711c429946063d133stoddard# /etc/minor_perm, a corresponding change must be made to
75960f20f88dad6bc67892c711c429946063d133stoddard# this class-action script.
75960f20f88dad6bc67892c711c429946063d133stoddard# - If an existing entry in minor_perm is having its
75960f20f88dad6bc67892c711c429946063d133stoddard# attributes e.g. permissions, ownership changed,
75960f20f88dad6bc67892c711c429946063d133stoddard# add it to the list produced by make_chattr_list below.
10b386767f6c87b45937244371cb751f0b454d16wrowe# - If an existing entry must be deleted, add it to
10b386767f6c87b45937244371cb751f0b454d16wrowe# the list produced by make_delete_list below.
10b386767f6c87b45937244371cb751f0b454d16wrowe# - If a new entry must be added to the file, add it to the
10b386767f6c87b45937244371cb751f0b454d16wrowe# list produced by make_add_list.
10b386767f6c87b45937244371cb751f0b454d16wrowe# - If a new entry is being added to minor_perm, but there
10b386767f6c87b45937244371cb751f0b454d16wrowe# may already be devices of that name on the system (e.g.
10b386767f6c87b45937244371cb751f0b454d16wrowe# we used the system default permissions in a previous release),
10b386767f6c87b45937244371cb751f0b454d16wrowe# and those old devices now need to have their attributes changed,
10b386767f6c87b45937244371cb751f0b454d16wrowe# add it to the make_chattr_list AND the make_add_list lists
97b758d0b174d7b7c5a1de1a583f5840ec3fc910trawick# If an entry in /etc/minor_perm needs to have its attributes
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein# changed, identify the entry in the list copied to /etc/chattr.$$
641cb23141f2238ed09e3b9fa79189225f8a2bcbrbb# by this function. The fields are:
641cb23141f2238ed09e3b9fa79189225f8a2bcbrbb# <device>:<minor> <old_attrs> <new_attrs> <optional list of logical
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# devices whose attributes
8bed76428f56e5c643174a2d6807c3f18016af5cbjh# will need to be changed>
8bed76428f56e5c643174a2d6807c3f18016af5cbjh# where an <attribute list> := <perm> <user> <group>
8bed76428f56e5c643174a2d6807c3f18016af5cbjh# NOTE: this list should also contain entries for nodes that previously
cfc020d6d6fc9b31d8945915e65a8787a796eb73stoddard# were not in /etc/minor_perm (which means the default mode of 600,
f824925ac58ff729289c017235eeb3bdd21ec3a2stoddardcat > /tmp/chattr.$$ << EOF
2aae6faee508221efbeaba5547ca79b7a20ef047stoddardvol:volctl 0600 root sys 0666 root sys /dev/volctl
2aae6faee508221efbeaba5547ca79b7a20ef047stoddardclone:llc1 0600 root sys 0666 root sys /dev/llc1
10b386767f6c87b45937244371cb751f0b454d16wroweclone:sound,sbpro 0666 root sys 0600 root sys /dev/sound/*
10b386767f6c87b45937244371cb751f0b454d16wrowesbpro:* 0666 root sys 0600 root sys /dev/sound/*
10b386767f6c87b45937244371cb751f0b454d16wrowelog:conslog 0620 root sys 0666 root sys /dev/conslog
10b386767f6c87b45937244371cb751f0b454d16wrowesy:tty 0666 root sys 0666 root tty /dev/tty
10b386767f6c87b45937244371cb751f0b454d16wroweicmp:icmp 0600 root sys 0666 root sys /dev/rawip
10b386767f6c87b45937244371cb751f0b454d16wroweicmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6
10b386767f6c87b45937244371cb751f0b454d16wroweip:ip 0660 root sys 0666 root sys /dev/ip
10b386767f6c87b45937244371cb751f0b454d16wroweip6:ip6 0660 root sys 0666 root sys /dev/ip6
75960f20f88dad6bc67892c711c429946063d133stoddardrts:rts 0660 root sys 0666 root sys /dev/rts
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardkeysock:keysock 0600 root sys 0666 root sys /dev/keysock
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardspdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardsad:admin 0600 root sys 0666 root sys /dev/sad/admin
56ca30c968906053ae61acb218420667bb58d996rbbfssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl
56ca30c968906053ae61acb218420667bb58d996rbbfssnap:* 0600 root sys 0640 root sys /dev/fssnap/*
56ca30c968906053ae61acb218420667bb58d996rbbclone:dnet 0600 root sys 0666 root sys /dev/dnet
56ca30c968906053ae61acb218420667bb58d996rbbdnet:* 0600 root sys 0666 root sys /dev/dnet*
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojclone:elxl 0600 root sys 0666 root sys /dev/elxl
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojelxl:* 0600 root sys 0666 root sys /dev/elxl*
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojclone:iprb 0600 root sys 0666 root sys /dev/iprb
56ca30c968906053ae61acb218420667bb58d996rbbiprb:* 0600 root sys 0666 root sys /dev/iprb*
0bff2f28ef945280c17099c142126178a78e1e54manojclone:pcelx 0600 root sys 0666 root sys /dev/pcelx
0bff2f28ef945280c17099c142126178a78e1e54manojpcelx:* 0600 root sys 0666 root sys /dev/pcelx*
0bff2f28ef945280c17099c142126178a78e1e54manojclone:spwr 0600 root sys 0666 root sys /dev/spwr
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardspwr:* 0600 root sys 0666 root sys /dev/spwr*
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardcpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc*
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardipf:* 0600 root sys 0666 root sys /dev/ipf
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardpfil:* 0600 root sys 0666 root sys /dev/pfil
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardscsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardfbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardlockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardprofile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardsdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardsystrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace
0bff2f28ef945280c17099c142126178a78e1e54manojclone:bge 0600 root sys 0666 root sys /dev/bge
0bff2f28ef945280c17099c142126178a78e1e54manojclone:rge 0600 root sys 0666 root sys /dev/rge
0bff2f28ef945280c17099c142126178a78e1e54manojclone:xge 0600 root sys 0666 root sys /dev/xge
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:nge 0600 root sys 0666 root sys /dev/nge
75960f20f88dad6bc67892c711c429946063d133stoddardclone:chxge 0600 root sys 0666 root sys /dev/chxge
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:pcn 0600 root sys 0666 root sys /dev/pcn
f03d292915be9977eaf74e9be7b0404aec226f84manojclone:rtls 0600 root sys 0666 root sys /dev/rtls
aa1faea36e4ae357bc603a2337b6adc54f5daec1manojclone:ath 0600 root sys 0666 root sys /dev/ath
bd929c73ef04789b7183b840d8db6e01d03a4d86rbbclone:ipw 0600 root sys 0666 root sys /dev/ipw
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:iwi 0600 root sys 0666 root sys /dev/iwi
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojclone:pcwl 0600 root sys 0666 root sys /dev/pcwl
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojclone:pcan 0600 root sys 0666 root sys /dev/pcan
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojclone:ral 0600 root sys 0666 root sys /dev/ral
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojclone:rtw 0600 root sys 0666 root sys /dev/rtw
ff849e4163ed879288f0df15f78b6c9d278ec804fanfclone:wpi 0600 root sys 0666 root sys /dev/wpi
ff849e4163ed879288f0df15f78b6c9d278ec804fanfclone:afe 0600 root sys 0666 root sys /dev/afe
9805ac88e1befa6dea11d8513023f150d8f8e807fanfclone:dmfe 0600 root sys 0666 root sys /dev/dmfe
9805ac88e1befa6dea11d8513023f150d8f8e807fanfclone:mxfe 0600 root sys 0666 root sys /dev/mxfe
9805ac88e1befa6dea11d8513023f150d8f8e807fanfbge:* 0600 root sys 0666 root sys /dev/bge*
9805ac88e1befa6dea11d8513023f150d8f8e807fanfrge:* 0600 root sys 0666 root sys /dev/rge*
df4a7c143b27b489dd2d865bb3f6668c8420b3a9fanfxge:* 0600 root sys 0666 root sys /dev/xge*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinnge:* 0600 root sys 0666 root sys /dev/nge*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteine1000g:* 0666 root root 0666 root sys /dev/e1000g*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinchxge:* 0600 root sys 0666 root sys /dev/chxge*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinpcn:* 0600 root sys 0666 root sys /dev/pcn*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinrtls:* 0600 root sys 0666 root sys /dev/rtls*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinath:* 0600 root sys 0666 root sys /dev/ath*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinipw:* 0600 root sys 0666 root sys /dev/ipw*
db3ccce11afac4fc1d4f51a65424412f7480c46cgsteiniwi:* 0600 root sys 0666 root sys /dev/iwi*
1e088f9182ba67f39713fcb850e11934be5f6d17gsteinpcwl:* 0600 root sys 0666 root sys /dev/pcwl*
dd4713dc5b186f4d1be7b88f86608fdb84cbe5d5gsteinpcan:* 0600 root sys 0666 root sys /dev/pcan*
dd4713dc5b186f4d1be7b88f86608fdb84cbe5d5gsteinral:* 0600 root sys 0666 root sys /dev/ral*
dd4713dc5b186f4d1be7b88f86608fdb84cbe5d5gsteinrtw:* 0600 root sys 0666 root sys /dev/rtw*
0eb7ca6cf812d98c534661ac474e873a32bf6325gsteinwpi:* 0600 root sys 0666 root sys /dev/wpi*
dd4713dc5b186f4d1be7b88f86608fdb84cbe5d5gsteinafe:* 0600 root sys 0666 root sys /dev/afe*
8d07897b52e3b7055874501f8a499e75800db206gsteindmfe:* 0600 root sys 0666 root sys /dev/dmfe*
8d07897b52e3b7055874501f8a499e75800db206gsteinmxfe:* 0600 root sys 0666 root sys /dev/mxfe*
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein# If an entry in /etc/minor_perm needs to be deleted, identify
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein# the entry in the list copied to /etc/delete.$$ by this function.
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein# The fields are:
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein# <device>:<minor> <optional list of logical devices to be deleted>
14cccaddba3a9263cf0d0ddc311e18f3e3dc9b0fgsteincat > /tmp/delete.$$ << EOF
14cccaddba3a9263cf0d0ddc311e18f3e3dc9b0fgsteinconsfb:consfb
c695093c99519a8509ac85642e35c216e9d9186fgsteinclone:ipsecah
8d07897b52e3b7055874501f8a499e75800db206gsteinclone:ipsecesp
6d886ec2d5055dd5da4cbf0e84d55b807ea1058agsteinclone:keysock
e1c3000228ddea532093e3a5ca1cdaa7353471begsteinprofile:profile
e1c3000228ddea532093e3a5ca1cdaa7353471begsteinasy:[a-z],cu
d5defd5a0c5cdbaf74b85939484dc2b6c8317d19manoj# If an entry needs to be added to /etc/minor_perm, add the first
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# field of the entry to the list created by this function. The
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# remainder of the entry will be extracted from the /etc/minor_perm
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# in the package being installed, so it is not necessary to supply
0bff2f28ef945280c17099c142126178a78e1e54manojcat > /tmp/add.$$ << EOF
fb777d35fc4730c312e161b3d803ae32700f6ca7saschadevinfo:devinfo
fb777d35fc4730c312e161b3d803ae32700f6ca7saschaopeneepr:openprom
2a6c49cfaef5979a5a06098f3ce987cd76769409manojpool:poolctl
f6a6245816cd866361da8c576b1f47c7a54b6610fanfsysmsg:msglog
f6a6245816cd866361da8c576b1f47c7a54b6610fanfsysmsg:sysmsg
f6a6245816cd866361da8c576b1f47c7a54b6610fanfipsecah:ipsecah
f6a6245816cd866361da8c576b1f47c7a54b6610fanfipsecesp:ipsecesp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojkeysock:keysock
2a6c49cfaef5979a5a06098f3ce987cd76769409manojspdsock:spdsock
2a6c49cfaef5979a5a06098f3ce987cd76769409manojdevinfo:devinfo,ro
2a6c49cfaef5979a5a06098f3ce987cd76769409manojcryptoadm:cryptoadm
2a6c49cfaef5979a5a06098f3ce987cd76769409manojcrypto:crypto
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingfasttrap: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