i.minorperm_i386 revision 9da57d7b0ddd8d73b676ce12c040362132cdd538
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#!/bin/sh
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein#
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# CDDL HEADER START
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#
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.
2deb319e6b3de239f45c16a3e9e836d44f1f7108rbb#
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanoj# or http://www.opensolaris.org/os/licensing.
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# See the License for the specific language governing permissions
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# and limitations under the License.
e3838a090d22197ee5f0d2c10b5a3d5e6f550f6erbb#
e3838a090d22197ee5f0d2c10b5a3d5e6f550f6erbb# 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
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# information: Portions Copyright [yyyy] [name of copyright owner]
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard#
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# CDDL HEADER END
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb#
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb#
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
632b0b53511f3bb9c32aa2869fbc73ee35081b38rbb# Use is subject to license terms.
632b0b53511f3bb9c32aa2869fbc73ee35081b38rbb#
632b0b53511f3bb9c32aa2869fbc73ee35081b38rbb#ident "%Z%%M% %I% %E% SMI"
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb#
f6a6245816cd866361da8c576b1f47c7a54b6610fanf
b7663b97a437dc089ac7a1a9ebd42e0c372a48b6gstein#
b7663b97a437dc089ac7a1a9ebd42e0c372a48b6gstein# NOTE: When a change is made to the source file for
b7663b97a437dc089ac7a1a9ebd42e0c372a48b6gstein# /etc/minor_perm, a corresponding change must be made to
b7663b97a437dc089ac7a1a9ebd42e0c372a48b6gstein# this class-action script.
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manoj# - If an existing entry in minor_perm is having its
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manoj# attributes e.g. permissions, ownership changed,
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# add it to the list produced by make_chattr_list below.
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard#
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard# - If an existing entry must be deleted, add it to
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard# the list produced by make_delete_list below.
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard#
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard# - If a new entry must be added to the file, add it to the
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard# list produced by make_add_list.
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard#
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.
75960f20f88dad6bc67892c711c429946063d133stoddard# we used the system default permissions in a previous release),
75960f20f88dad6bc67892c711c429946063d133stoddard# and those old devices now need to have their attributes changed,
75960f20f88dad6bc67892c711c429946063d133stoddard# add it to the make_chattr_list AND the make_add_list lists
75960f20f88dad6bc67892c711c429946063d133stoddard#
75960f20f88dad6bc67892c711c429946063d133stoddard
75960f20f88dad6bc67892c711c429946063d133stoddard#
75960f20f88dad6bc67892c711c429946063d133stoddard# If an entry in /etc/minor_perm needs to have its attributes
10b386767f6c87b45937244371cb751f0b454d16wrowe# changed, identify the entry in the list copied to /etc/chattr.$$
10b386767f6c87b45937244371cb751f0b454d16wrowe# by this function. The fields are:
10b386767f6c87b45937244371cb751f0b454d16wrowe#
10b386767f6c87b45937244371cb751f0b454d16wrowe# <device>:<minor> <old_attrs> <new_attrs> <optional list of logical
10b386767f6c87b45937244371cb751f0b454d16wrowe# devices whose attributes
10b386767f6c87b45937244371cb751f0b454d16wrowe# will need to be changed>
10b386767f6c87b45937244371cb751f0b454d16wrowe#
10b386767f6c87b45937244371cb751f0b454d16wrowe# where an <attribute list> := <perm> <user> <group>
10b386767f6c87b45937244371cb751f0b454d16wrowe#
10b386767f6c87b45937244371cb751f0b454d16wrowe# NOTE: this list should also contain entries for nodes that previously
10b386767f6c87b45937244371cb751f0b454d16wrowe# were not in /etc/minor_perm (which means the default mode of 600,
a9e07e4f90adcc7bc768db3055431c3dcd560cd1manoj# owner/group == root/sys), but now have an entry
f6a6245816cd866361da8c576b1f47c7a54b6610fanf#
f6a6245816cd866361da8c576b1f47c7a54b6610fanf
97b758d0b174d7b7c5a1de1a583f5840ec3fc910trawickmake_chattr_list()
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein{
2a6c49cfaef5979a5a06098f3ce987cd76769409manojcat > /tmp/chattr.$$ << EOF
8bed76428f56e5c643174a2d6807c3f18016af5cbjhvol:volctl 0600 root sys 0666 root sys /dev/volctl
8bed76428f56e5c643174a2d6807c3f18016af5cbjhclone:llc1 0600 root sys 0666 root sys /dev/llc1
8bed76428f56e5c643174a2d6807c3f18016af5cbjhclone:sound,sbpro 0666 root sys 0600 root sys /dev/sound/*
8bed76428f56e5c643174a2d6807c3f18016af5cbjhsbpro:* 0666 root sys 0600 root sys /dev/sound/*
8bed76428f56e5c643174a2d6807c3f18016af5cbjhlog:conslog 0620 root sys 0666 root sys /dev/conslog
cfc020d6d6fc9b31d8945915e65a8787a796eb73stoddardsy:tty 0666 root sys 0666 root tty /dev/tty
cfc020d6d6fc9b31d8945915e65a8787a796eb73stoddardicmp:icmp 0600 root sys 0666 root sys /dev/rawip
cfc020d6d6fc9b31d8945915e65a8787a796eb73stoddardicmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6
f824925ac58ff729289c017235eeb3bdd21ec3a2stoddardip:ip 0660 root sys 0666 root sys /dev/ip
f824925ac58ff729289c017235eeb3bdd21ec3a2stoddardip6:ip6 0660 root sys 0666 root sys /dev/ip6
f824925ac58ff729289c017235eeb3bdd21ec3a2stoddardrts:rts 0660 root sys 0666 root sys /dev/rts
f824925ac58ff729289c017235eeb3bdd21ec3a2stoddardkeysock:keysock 0600 root sys 0666 root sys /dev/keysock
2aae6faee508221efbeaba5547ca79b7a20ef047stoddardipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah
2aae6faee508221efbeaba5547ca79b7a20ef047stoddardipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp
10b386767f6c87b45937244371cb751f0b454d16wrowespdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock
10b386767f6c87b45937244371cb751f0b454d16wrowesad:admin 0600 root sys 0666 root sys /dev/sad/admin
10b386767f6c87b45937244371cb751f0b454d16wrowefssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl
10b386767f6c87b45937244371cb751f0b454d16wrowefssnap:* 0600 root sys 0640 root sys /dev/fssnap/*
10b386767f6c87b45937244371cb751f0b454d16wroweclone:dnet 0600 root sys 0666 root sys /dev/dnet
10b386767f6c87b45937244371cb751f0b454d16wrowednet:* 0600 root sys 0666 root sys /dev/dnet*
10b386767f6c87b45937244371cb751f0b454d16wroweclone:elxl 0600 root sys 0666 root sys /dev/elxl
10b386767f6c87b45937244371cb751f0b454d16wroweelxl:* 0600 root sys 0666 root sys /dev/elxl*
75960f20f88dad6bc67892c711c429946063d133stoddardclone:iprb 0600 root sys 0666 root sys /dev/iprb
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardiprb:* 0600 root sys 0666 root sys /dev/iprb*
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardclone:pcelx 0600 root sys 0666 root sys /dev/pcelx
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardpcelx:* 0600 root sys 0666 root sys /dev/pcelx*
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardclone:spwr 0600 root sys 0666 root sys /dev/spwr
a5ed555df952c85bc1b179f5981e8a6c54ba16e6stoddardspwr:* 0600 root sys 0666 root sys /dev/spwr*
56ca30c968906053ae61acb218420667bb58d996rbbcpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc*
56ca30c968906053ae61acb218420667bb58d996rbbipf:* 0600 root sys 0666 root sys /dev/ipf
56ca30c968906053ae61acb218420667bb58d996rbbpfil:* 0600 root sys 0666 root sys /dev/pfil
56ca30c968906053ae61acb218420667bb58d996rbbscsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojfbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojlockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojprofile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile
56ca30c968906053ae61acb218420667bb58d996rbbsdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt
0bff2f28ef945280c17099c142126178a78e1e54manojsystrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace
0bff2f28ef945280c17099c142126178a78e1e54manojclone:bge 0600 root sys 0666 root sys /dev/bge
0bff2f28ef945280c17099c142126178a78e1e54manojclone:ixgbe 0600 root sys 0666 root sys /dev/ixgbe
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:rge 0600 root sys 0666 root sys /dev/rge
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:xge 0600 root sys 0666 root sys /dev/xge
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:nge 0600 root sys 0666 root sys /dev/nge
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:chxge 0600 root sys 0666 root sys /dev/chxge
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:pcn 0600 root sys 0666 root sys /dev/pcn
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:rtls 0600 root sys 0666 root sys /dev/rtls
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:ath 0600 root sys 0666 root sys /dev/ath
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:ipw 0600 root sys 0666 root sys /dev/ipw
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:iwi 0600 root sys 0666 root sys /dev/iwi
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:iwk 0600 root sys 0666 root sys /dev/iwk
0bff2f28ef945280c17099c142126178a78e1e54manojclone:pcwl 0600 root sys 0666 root sys /dev/pcwl
0bff2f28ef945280c17099c142126178a78e1e54manojclone:pcan 0600 root sys 0666 root sys /dev/pcan
0bff2f28ef945280c17099c142126178a78e1e54manojclone:ral 0600 root sys 0666 root sys /dev/ral
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:rtw 0600 root sys 0666 root sys /dev/rtw
75960f20f88dad6bc67892c711c429946063d133stoddardclone:wpi 0600 root sys 0666 root sys /dev/wpi
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardclone:afe 0600 root sys 0666 root sys /dev/afe
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddardclone:dmfe 0600 root sys 0666 root sys /dev/dmfe
aa1faea36e4ae357bc603a2337b6adc54f5daec1manojclone:mxfe 0600 root sys 0666 root sys /dev/mxfe
f03d292915be9977eaf74e9be7b0404aec226f84manojbge:* 0600 root sys 0666 root sys /dev/bge*
f03d292915be9977eaf74e9be7b0404aec226f84manojixgbe:* 0600 root sys 0666 root sys /dev/ixgbe*
f03d292915be9977eaf74e9be7b0404aec226f84manojrge:* 0600 root sys 0666 root sys /dev/rge*
aa1faea36e4ae357bc603a2337b6adc54f5daec1manojxge:* 0600 root sys 0666 root sys /dev/xge*
bd929c73ef04789b7183b840d8db6e01d03a4d86rbbnge:* 0600 root sys 0666 root sys /dev/nge*
2a6c49cfaef5979a5a06098f3ce987cd76769409manoje1000g:* 0666 root root 0666 root sys /dev/e1000g*
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojchxge:* 0600 root sys 0666 root sys /dev/chxge*
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojpcn:* 0600 root sys 0666 root sys /dev/pcn*
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojrtls:* 0600 root sys 0666 root sys /dev/rtls*
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojath:* 0600 root sys 0666 root sys /dev/ath*
ff849e4163ed879288f0df15f78b6c9d278ec804fanfipw:* 0600 root sys 0666 root sys /dev/ipw*
ff849e4163ed879288f0df15f78b6c9d278ec804fanfiwi:* 0600 root sys 0666 root sys /dev/iwi*
9805ac88e1befa6dea11d8513023f150d8f8e807fanfiwk:* 0600 root sys 0666 root sys /dev/iwk*
9805ac88e1befa6dea11d8513023f150d8f8e807fanfpcwl:* 0600 root sys 0666 root sys /dev/pcwl*
9805ac88e1befa6dea11d8513023f150d8f8e807fanfpcan:* 0600 root sys 0666 root sys /dev/pcan*
9805ac88e1befa6dea11d8513023f150d8f8e807fanfral:* 0600 root sys 0666 root sys /dev/ral*
df4a7c143b27b489dd2d865bb3f6668c8420b3a9fanfrtw:* 0600 root sys 0666 root sys /dev/rtw*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinwpi:* 0600 root sys 0666 root sys /dev/wpi*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinafe:* 0600 root sys 0666 root sys /dev/afe*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteindmfe:* 0600 root sys 0666 root sys /dev/dmfe*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinmxfe:* 0600 root sys 0666 root sys /dev/mxfe*
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgsteinEOF
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgstein}
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgstein
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein#
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein# If an entry in /etc/minor_perm needs to be deleted, identify
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein# the entry in the list copied to /etc/delete.$$ by this function.
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein# The fields are:
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein#
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein# <device>:<minor> <optional list of logical devices to be deleted>
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein#
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein
93c5cba06b623ebe8e4372e886eece12d9a80c3egsteinmake_delete_list()
93c5cba06b623ebe8e4372e886eece12d9a80c3egstein{
93c5cba06b623ebe8e4372e886eece12d9a80c3egsteincat > /tmp/delete.$$ << EOF
93c5cba06b623ebe8e4372e886eece12d9a80c3egsteinrip:rawip
2a6c49cfaef5979a5a06098f3ce987cd76769409manojconsfb:consfb
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:el
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:elx
d5defd5a0c5cdbaf74b85939484dc2b6c8317d19manojclone:sle
d5defd5a0c5cdbaf74b85939484dc2b6c8317d19manojclone:sie
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:sp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:ip
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:icmp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:udp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:tcp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:rts
0bff2f28ef945280c17099c142126178a78e1e54manojclone:arp
0bff2f28ef945280c17099c142126178a78e1e54manojclone:ipsecah
0bff2f28ef945280c17099c142126178a78e1e54manojclone:ipsecesp
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingclone:keysock
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawickclone:smc
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawickclone:tr
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawickelx:*
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawickwin:*
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawickcmtp:*
2a6c49cfaef5979a5a06098f3ce987cd76769409manojprofile:profile
2a6c49cfaef5979a5a06098f3ce987cd76769409manojasy:[a-z]
2a6c49cfaef5979a5a06098f3ce987cd76769409manojasy:[a-z],cu
40a5b7189dbbb28e107bf008ee625f2f0142c2ccdgaudeti2o_bs:*
2a6c49cfaef5979a5a06098f3ce987cd76769409manojEOF
dbf0c7bef06259486cd2748a2d0e82f27e099d6efielding}
dbf0c7bef06259486cd2748a2d0e82f27e099d6efielding
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# 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
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# it here.
f6a6245816cd866361da8c576b1f47c7a54b6610fanf#
f6a6245816cd866361da8c576b1f47c7a54b6610fanf
f6a6245816cd866361da8c576b1f47c7a54b6610fanfmake_add_list()
f6a6245816cd866361da8c576b1f47c7a54b6610fanf{
f6a6245816cd866361da8c576b1f47c7a54b6610fanfcat > /tmp/add.$$ << EOF
2a6c49cfaef5979a5a06098f3ce987cd76769409manojvol:volctl
2a6c49cfaef5979a5a06098f3ce987cd76769409manojclone:llc1
2a6c49cfaef5979a5a06098f3ce987cd76769409manojtnf:tnfctl
2a6c49cfaef5979a5a06098f3ce987cd76769409manojtnf:tnfmap
2a6c49cfaef5979a5a06098f3ce987cd76769409manojst:*
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingpm:*
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingdevinfo:devinfo
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingopeneepr:openprom
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingwc:*
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingip:ip
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingip6:ip6
2a6c49cfaef5979a5a06098f3ce987cd76769409manojicmp:icmp
670734c2ee137c587411795c6f82566c9d3729b7coaricmp6:icmp6
2a6c49cfaef5979a5a06098f3ce987cd76769409manojudp:udp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojudp6:udp6
2a6c49cfaef5979a5a06098f3ce987cd76769409manojtcp:tcp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojtcp6:tcp6
2a6c49cfaef5979a5a06098f3ce987cd76769409manojrts:rts
2a6c49cfaef5979a5a06098f3ce987cd76769409manojarp:arp
2a6c49cfaef5979a5a06098f3ce987cd76769409manojpoll:*
2a6c49cfaef5979a5a06098f3ce987cd76769409manojpool:pool
2a6c49cfaef5979a5a06098f3ce987cd76769409manojpool:poolctl
2a6c49cfaef5979a5a06098f3ce987cd76769409manojcpc:shared
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingsysmsg:msglog
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingsysmsg:sysmsg
d6b3cb141f0667101c1bca883ad15b383402c93bfieldingipsecah:ipsecah
ipsecesp:ipsecesp
keysock:keysock
spdsock:spdsock
devinfo:devinfo,ro
lofi:*
lofi:ctl
sgen:*
fssnap:*
fssnap:ctl
rsm:*
random:*
mm:allkmem
clone:dnet
dnet:*
clone:elxl
elxl:*
clone:ibd
ibd:*
clone:iprb
iprb:*
clone:pcelx
pcelx:*
clone:spwr
spwr:*
sysevent:*
ramdisk:*
ramdisk:ctl
cryptoadm:cryptoadm
crypto:crypto
dtrace:*
fasttrap:fasttrap
ipf:*
pfil:*
bl:*
sctp:*
sctp6:*
vni:*
cpuid:self
clone:bge
clone:ixgbe
clone:rge
clone:xge
clone:nge
clone:e1000g
clone:chxge
clone:pcn
clone:rtls
clone:ath
clone:ipw
clone:iwi
clone:iwk
clone:pcwl
clone:pcan
clone:ral
clone:rtw
clone:wpi
clone:afe
clone:dmfe
clone:mxfe
bge:*
ixgbe:*
rge:*
xge:*
nge:*
e1000g:*
chxge:*
pcn:*
rtls:*
ath:*
ipw:*
iwi:*
iwk:*
pcwl:*
pcan:*
ral:*
rtw:*
wpi:*
afe:*
dmfe:*
mxfe:*
bmc:bmc
dld:*
aggr:*
smbios:smbios
zfs:*
zfs:zfs
scsi_vhci:*
kssl:*
fbt:fbt
profile:profile
sdt:sdt
softmac:*
systrace:systrace
lx_ptm:lx_ptmajor
lx_systrace:*
physmem:*
asy:*
asy:*,cu
ucode:*
acpi_drv:*
smbsrv:*
vscan:*
nsmb:*
EOF
}
PATH="/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin"
export PATH
# Internal routine to create a sed script which can be used to
# escape all shell globbing metacharacters in a path.
create_esc_sedscript()
{
cat > /tmp/esc.sed.$$ << EOF
s/\*/\\\\*/g
s/\?/\\\\?/g
s/\[/\\\\[/g
s/\]/\\\\]/g
EOF
}
# Internal routine to convert an entry in a /tmp/chwhatever.$$ file to
# an appropriately escaped pattern which can be used to grep into minor_perm.
entry2pattern()
{
# the first argument is the 'key' field from the change file.
# entries can contain shell globbing characters to match
# several devices - hence all the palaver below.
printf '%s' `echo "$1" | sed \
-e 's/\*/\\\\*/g' -e 's/\?/\\\\?/g' \
-e 's/\./\\\\./g' -e 's/\[/\\\\[/g' \
-e 's/\]/\\\\]/g'`
shift
# the remaining optional arguments are tokens separated by white-space
if [ $# = 0 ] ; then
printf '[ \t]'
else
while [ -n "$1" ]
do
printf '[ \t][ \t]*%s' $1
shift
done
printf '[ \t]*$'
fi
}
while read src dest
do
if [ ! -f $dest ] ; then
cp $src $dest
else
rm -f /tmp/*.$$
create_esc_sedscript
make_chattr_list
make_delete_list
make_add_list
#
# Process the list of devices whose attributes are to be
# changed. Find those that actually need to be
# applied to the file. For each change that needs
# to be applied, add an entry for it to the sed
# script that will eventually be applied to the
# currently-installed /etc/minor_perm file. Also,
# add an entry to the /tmp/chdevs.$$ file, which
# contains the list of logical names of devices
# whose permissions need to be changed.
#
cat /tmp/chattr.$$ | \
while read key oldp oldu oldg newp newu newg chdevs
do
do_chdevs=no
#
# First determine whether the device entry
# is already in the file, but with the old
# permissions. If so, the entry needs to be
# modified and the devices in the chdevs list
# need to have their permissions and ownerships
# changed.
#
grepstr=`entry2pattern "${key}" $oldp $oldu $oldg`
if grep "$grepstr" $dest > /dev/null 2>&1; then
echo "s/${grepstr}/$key $newp $newu $newg/" \
>> /tmp/sedscript.$$
do_chdevs=yes
fi
#
# Now determine whether the device entry is
# in the file at all. If not, it is a new
# entry, but there may already be devices
# on the system whose permissions need to
# be changed.
#
grepstr=`entry2pattern "${key}"`
grep "${grepstr}" $dest > /dev/null 2>&1
if [ $? != 0 ] ; then
do_chdevs=yes
fi
if [ $do_chdevs = yes -a "$chdevs" != "" ] ; then
xchdevs=`echo "$chdevs" | \
sed -f /tmp/esc.sed.$$`
for m in $xchdevs ; do
echo "$m" $oldp $oldu $oldg \
$newp $newu $newg >> /tmp/chdevs.$$
done
fi
done
# sort the "change attributes" list
if [ -s /tmp/chdevs.$$ ] ; then
sort -u /tmp/chdevs.$$ > /tmp/tmp.$$
mv /tmp/tmp.$$ /tmp/chdevs.$$
fi
#
# Process the list of devices to be deleted.
# Find those that actually need to be deleted
# from the file. For each entry to be deleted,
# add an entry for it to the sed script that will
# eventually be applied to the currently-installed
# /etc/minor_perm file. Also, add an entry to the
# /tmp/deldevs.$$ file, which contains the list of
# logical names of devices to be deleted.
#
cat /tmp/delete.$$ | while read key deldevs
do
grepstr=`entry2pattern "${key}"`
if grep "$grepstr" $dest > /dev/null 2>&1; then
echo "/${grepstr}/d" >> /tmp/sedscript.$$
if [ "$deldevs" != "" ] ; then
xdeldevs=`echo "$deldevs" | \
sed -f /tmp/esc.sed.$$`
for m in $xdeldevs ; do
echo "$m" >> /tmp/deldevs.$$
done
fi
fi
done
if [ -s /tmp/deldevs.$$ ] ; then
sort -u /tmp/deldevs.$$ > /tmp/tmp.$$
mv /tmp/tmp.$$ /tmp/deldevs.$$
fi
#
# Apply the sed script possibly built above to the
# currently-installed /etc/minor_perm file.
#
if [ -s /tmp/sedscript.$$ ] ; then
sed -f /tmp/sedscript.$$ $dest > /tmp/tmp.$$
cp /tmp/tmp.$$ $dest
fi
# For all entries in minor_perm whose attributes had
# to be corrected, correct the relevant attributes of the
# already-existing devices that correspond to those
# entries.
#
if [ -s /tmp/chdevs.$$ -a "$PKG_INSTALL_ROOT" != "" -a \
"$PKG_INSTALL_ROOT" != "/" ] ; then
cat /tmp/chdevs.$$ |\
while read device oldp oldu oldg newp newu newg
do
#
# Note that we take pains -only- to change
# the permission/ownership of devices that
# have kept their original permissions.
#
for dev in $PKG_INSTALL_ROOT/$device; do
find $dev -follow -perm $oldp -exec \
chmod $newp $dev \; >/dev/null 2>&1
find $dev -follow -user $oldu -exec \
chown $newu $dev \; >/dev/null 2>&1
find $dev -follow -group $oldg -exec \
chgrp $newg $dev \; >/dev/null 2>&1
done
done
fi
#
# For all entries in minor_perm that were deleted,
# remove the /dev entries that point to device nodes
# that correspond to those entries.
#
if [ -s /tmp/deldevs.$$ -a "$PKG_INSTALL_ROOT" != "" -a \
"$PKG_INSTALL_ROOT" != "/" ] ; then
cat /tmp/deldevs.$$ | while read device
do
rm -f $PKG_INSTALL_ROOT/$device
done
fi
cat /tmp/add.$$ | while read key
do
grepstr=`entry2pattern "${key}"`
grep "$grepstr" $dest > /dev/null 2>&1
if [ $? != 0 ] ; then
grep "$grepstr" $src >> $dest
fi
done
rm -f /tmp/*.$$
fi
done
exit 0