i.minorperm_sparc revision 1a6ee84845638e98d64e80e15e255a8f15a12d02
# See the License for the specific language governing permissions # and limitations under the License. # When distributing Covered Code, include this CDDL HEADER in each # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # ident "%Z%%M% %I% %E% SMI" # NOTE: When a change is made to the source file for # this class-action script. # - If an existing entry in minor_perm is having its # attributes e.g. permissions, ownership changed, # add it to the list produced by make_chattr_list below. # - If an existing entry must be deleted, add it to # the list produced by make_delete_list below. # - If a new entry must be added to the file, add it to the # list produced by make_add_list. # - If a new entry is being added to minor_perm, but there # may already be devices of that name on the system (e.g. # we used the system default permissions in a previous release), # and those old devices now need to have their attributes changed, # add it to the make_chattr_list AND the make_add_list lists # changed, identify the entry in the list copied to /etc/chattr.$$ # by this function. The fields are: # <device>:<minor> <old_attrs> <new_attrs> <optional list of logical # devices whose attributes # will need to be changed> # where an <attribute list> := <perm> <user> <group> audio:* 0666 root sys 0600 root sys /dev/sound/* vol:volctl 0600 root sys 0666 root sys /dev/volctl sad:user 0600 root sys 0666 root sys /dev/sad/user se:* 0666 root sys 0600 uucp uucp /dev/cua/* zs:* 0666 root sys 0600 uucp uucp /dev/cua/* su:* 0666 root sys 0600 uucp uucp /dev/cua/* ssd:* 0666 root sys 0640 root sys /dev/dsk/* /dev/rdsk/* dad:* 0600 root sys 0640 root sys /dev/dsk/* /dev/rdsk/* cpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc* log:conslog 0622 root sys 0666 root sys /dev/conslog sy:tty 0666 root sys 0666 root tty /dev/tty cvc:* 0666 root sys 0600 root sys cvcredir:* 0666 root sys 0600 root sys ssm:* 0600 root sys 0640 root sys /devices/ssm*:* icmp:icmp 0600 root sys 0666 root sys /dev/rawip icmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6 ip:ip 0660 root sys 0666 root sys /dev/ip ip6:ip6 0660 root sys 0666 root sys /dev/ip6 rts:rts 0660 root sys 0666 root sys /dev/rts keysock:keysock 0600 root sys 0666 root sys /dev/keysock ipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah ipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp spdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock sad:admin 0600 root sys 0666 root sys /dev/sad/admin fssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl fssnap:* 0600 root sys 0640 root sys /dev/fssnap/* clone:ce 0600 root sys 0666 root sys /dev/ce clone:eri 0600 root sys 0666 root sys /dev/eri clone:ge 0600 root sys 0666 root sys /dev/ge clone:hme 0600 root sys 0666 root sys /dev/hme clone:qfe 0600 root sys 0666 root sys /dev/qfe clone:bge 0600 root sys 0666 root sys /dev/bge clone:rge 0600 root sys 0666 root sys /dev/rge clone:xge 0600 root sys 0666 root sys /dev/xge clone:nge 0600 root sys 0666 root sys /dev/nge clone:e1000g 0666 root root 0666 root sys /dev/e1000g clone:chxge 0600 root sys 0666 root sys /dev/chxge clone:vsw 0600 root sys 0666 root sys /dev/vsw clone:vnet 0600 root sys 0666 root sys /dev/vnet clone:pcwl 0600 root sys 0666 root sys /dev/pcwl clone:pcan 0600 root sys 0666 root sys /dev/pcan clone:afe 0600 root sys 0666 root sys /dev/afe clone:mxfe 0600 root sys 0666 root sys /dev/mxfe clone:rtls 0600 root sys 0666 root sys /dev/rtls bge:* 0600 root sys 0666 root sys /dev/bge* rge:* 0600 root sys 0666 root sys /dev/rge* xge:* 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* vsw:* 0600 root sys 0666 root sys /dev/vsw* vnet:* 0600 root sys 0666 root sys /dev/vnet* pcwl:* 0600 root sys 0666 root sys /dev/pcwl* pcan:* 0600 root sys 0666 root sys /dev/pcan* clone:dmfe 0600 root sys 0666 root sys /dev/dmfe dmfe:* 0600 root sys 0666 root sys /dev/dmfe* clone:pcelx 0600 root sys 0666 root sys /dev/pcelx pcelx:* 0600 root sys 0666 root sys /dev/pcelx* afe:* 0600 root sys 0666 root sys /dev/afe* mxfe:* 0600 root sys 0666 root sys /dev/mxfe* rtls:* 0600 root sys 0666 root sys /dev/rtls* ipf:* 0600 root sys 0666 root sys /dev/ipf pfil:* 0600 root sys 0666 root sys /dev/pfil scsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl fbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt lockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat profile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile sdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt systrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace # the entry in the list copied to /etc/delete.$$ by this function. # <device>:<minor> <optional list of logical devices to be deleted> mm:mbio /dev/mbio /devices/pseudo/mm:mbio mm:mbmem /dev/mbmem /devices/pseudo/mm:mbmem # 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 # Make sure /dev/volctl gets its permissions corrected. # (systems upgraded from 2.2 to 2.3 may have a correct # but the actual /dev/volctl node may have the wrong # 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 built above to the # Special case code to handle bug in 2.1, 2.2, and # early 2.3 releases: the link from /dev/sound/* # has one extra set of "../"'s in the link. This # doesn't cause problems in normal operation # because ".."'s that would take the search path # higher than the real root are ignored. However, # during upgrade, when the system being upgraded is # mounted at /a, the extra ".." in the link causes # the link to be unresolvable. The link must be # corrected so that the chmod of /dev/sound/* # if it's not a symlink, continue # otherwise, link can't be followed if [
"$link" =
"" ] ;
then # it worked, so replace old link with new # 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.