i.minorperm_i386 revision 84f7a9b9dca4f23b5f50edef0e59d7eb44301114
346N/A# The contents of this file are subject to the terms of the 346N/A# Common Development and Distribution License (the "License"). 346N/A# You may not use this file except in compliance with the License. 346N/A# See the License for the specific language governing permissions 346N/A# and limitations under the License. 346N/A# When distributing Covered Code, include this CDDL HEADER in each 346N/A# If applicable, add the following below this CDDL HEADER, with the 346N/A# fields enclosed by brackets "[]" replaced with your own identifying 346N/A# information: Portions Copyright [yyyy] [name of copyright owner] 783N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 346N/A# Use is subject to license terms. 346N/A#ident "%Z%%M% %I% %E% SMI" 346N/A# NOTE: When a change is made to the source file for 346N/A# this class-action script. 346N/A# - If an existing entry in minor_perm is having its 346N/A# attributes e.g. permissions, ownership changed, 618N/A# add it to the list produced by make_chattr_list below. 346N/A# - If an existing entry must be deleted, add it to 844N/A# the list produced by make_delete_list below. 618N/A# - If a new entry must be added to the file, add it to the 346N/A# list produced by make_add_list. 346N/A# - If a new entry is being added to minor_perm, but there 346N/A# may already be devices of that name on the system (e.g. 346N/A# we used the system default permissions in a previous release), 844N/A# and those old devices now need to have their attributes changed, 844N/A# add it to the make_chattr_list AND the make_add_list lists 346N/A# by this function. The fields are: 844N/A# <device>:<minor> <old_attrs> <new_attrs> <optional list of logical 618N/A# devices whose attributes 346N/A# will need to be changed> 346N/A# where an <attribute list> := <perm> <user> <group> 346N/A# NOTE: this list should also contain entries for nodes that previously 346N/Avol:volctl 0600 root sys 0666 root sys /dev/volctl 346N/Aclone:llc1 0600 root sys 0666 root sys /dev/llc1 346N/Aclone:sound,sbpro 0666 root sys 0600 root sys /dev/sound/* 346N/Asbpro:* 0666 root sys 0600 root sys /dev/sound/* 346N/Alog:conslog 0620 root sys 0666 root sys /dev/conslog 346N/Asy:tty 0666 root sys 0666 root tty /dev/tty 346N/Aicmp:icmp 0600 root sys 0666 root sys /dev/rawip 346N/Aicmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6 346N/Aip:ip 0660 root sys 0666 root sys /dev/ip 346N/Aip6:ip6 0660 root sys 0666 root sys /dev/ip6 346N/Arts:rts 0660 root sys 0666 root sys /dev/rts 346N/Akeysock:keysock 0600 root sys 0666 root sys /dev/keysock 346N/Aipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah 351N/Aipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp 351N/Aspdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock 351N/Asad:admin 0600 root sys 0666 root sys /dev/sad/admin 351N/Afssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl 351N/Afssnap:* 0600 root sys 0640 root sys /dev/fssnap/* 346N/Aclone:dnet 0600 root sys 0666 root sys /dev/dnet 351N/Adnet:* 0600 root sys 0666 root sys /dev/dnet* 346N/Aclone:elxl 0600 root sys 0666 root sys /dev/elxl 346N/Aelxl:* 0600 root sys 0666 root sys /dev/elxl* 346N/Aclone:iprb 0600 root sys 0666 root sys /dev/iprb 346N/Aiprb:* 0600 root sys 0666 root sys /dev/iprb* 346N/Aclone:pcelx 0600 root sys 0666 root sys /dev/pcelx 346N/Apcelx:* 0600 root sys 0666 root sys /dev/pcelx* 346N/Aclone:spwr 0600 root sys 0666 root sys /dev/spwr 346N/Aspwr:* 0600 root sys 0666 root sys /dev/spwr* 346N/Acpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc* 346N/Aipf:* 0600 root sys 0666 root sys /dev/ipf 346N/Apfil:* 0600 root sys 0666 root sys /dev/pfil 346N/Ascsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl 346N/Afbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt 346N/Alockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat 346N/Aprofile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile 346N/Asdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt 346N/Asystrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace 346N/Aclone:bge 0600 root sys 0666 root sys /dev/bge 346N/Aclone:rge 0600 root sys 0666 root sys /dev/rge 346N/Aclone:xge 0600 root sys 0666 root sys /dev/xge 346N/Aclone:nge 0600 root sys 0666 root sys /dev/nge 346N/Aclone:chxge 0600 root sys 0666 root sys /dev/chxge 346N/Aclone:pcn 0600 root sys 0666 root sys /dev/pcn 346N/Aclone:rtls 0600 root sys 0666 root sys /dev/rtls 346N/Aclone:ath 0600 root sys 0666 root sys /dev/ath 346N/Aclone:ipw 0600 root sys 0666 root sys /dev/ipw 346N/Aclone:iwi 0600 root sys 0666 root sys /dev/iwi 346N/Aclone:pcwl 0600 root sys 0666 root sys /dev/pcwl 346N/Aclone:pcan 0600 root sys 0666 root sys /dev/pcan 346N/Aclone:wpi 0600 root sys 0666 root sys /dev/wpi 346N/Abge:* 0600 root sys 0666 root sys /dev/bge* 346N/Arge:* 0600 root sys 0666 root sys /dev/rge* 346N/Axge:* 0600 root sys 0666 root sys /dev/xge* nge:* 0600 root sys 0666 root sys /dev/nge* e1000g:* 0666 root root 0666 root sys /dev/e1000g* chxge:* 0600 root sys 0666 root sys /dev/chxge* pcn:* 0600 root sys 0666 root sys /dev/pcn* rtls:* 0600 root sys 0666 root sys /dev/rtls* ath:* 0600 root sys 0666 root sys /dev/ath* ipw:* 0600 root sys 0666 root sys /dev/ipw* iwi:* 0600 root sys 0666 root sys /dev/iwi* pcwl:* 0600 root sys 0666 root sys /dev/pcwl* pcan:* 0600 root sys 0666 root sys /dev/pcan* wpi:* 0600 root sys 0666 root sys /dev/wpi* # the entry in the list copied to /etc/delete.$$ by this function. # <device>:<minor> <optional list of logical devices to be deleted> # If an entry needs to be added to /etc/minor_perm, add the first # field of the entry to the list created by this function. The # remainder of the entry will be extracted from the /etc/minor_perm # in the package being installed, so it is not necessary to supply # Internal routine to create a sed script which can be used to # escape all shell globbing metacharacters in a path. # 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. # 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. -e 's/\*/\\\\*/g' -e 's/\?/\\\\?/g' \ -e 's/\./\\\\./g' -e 's/\[/\\\\[/g' \ # the remaining optional arguments are tokens separated by white-space # 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 # add an entry to the /tmp/chdevs.$$ file, which # contains the list of logical names of devices # whose permissions need to be changed. # 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 # 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 # sort the "change attributes" list # 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 # /tmp/deldevs.$$ file, which contains the list of # logical names of devices to be deleted. # Apply the sed script possibly built above to the # 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 # Note that we take pains -only- to change # have kept their original permissions. # For all entries in minor_perm that were deleted, # remove the /dev entries that point to device nodes # that correspond to those entries.