i.minorperm_sparc revision 698117d998d9d9da52cb35d7f8a594fd43f68c33
486N/A# The contents of this file are subject to the terms of the 486N/A# Common Development and Distribution License (the "License"). 486N/A# You may not use this file except in compliance with the License. 6983N/A# See the License for the specific language governing permissions 486N/A# and limitations under the License. 486N/A# When distributing Covered Code, include this CDDL HEADER in each 6983N/A# If applicable, add the following below this CDDL HEADER, with the 6983N/A# fields enclosed by brackets "[]" replaced with your own identifying 6983N/A# information: Portions Copyright [yyyy] [name of copyright owner] 486N/A# Copyright 2010 Sun Microsystems, Inc. All rights reserved. 4103N/A# Use is subject to license terms. 486N/A# NOTE: When a change is made to the source file for 486N/A# this class-action script. 486N/A# - If an existing entry in minor_perm is having its 486N/A# attributes e.g. permissions, ownership changed, 486N/A# add it to the list produced by make_chattr_list below. 486N/A# - If an existing entry must be deleted, add it to 619N/A# the list produced by make_delete_list below. 619N/A# - If a new entry must be added to the file, add it to the 619N/A# list produced by make_add_list. 3488N/A# - If a new entry is being added to minor_perm, but there 619N/A# may already be devices of that name on the system (e.g. 619N/A# we used the system default permissions in a previous release), 619N/A# and those old devices now need to have their attributes changed, 3824N/A# add it to the make_chattr_list AND the make_add_list lists 5636N/A# by this function. The fields are: 5636N/A# <device>:<minor> <old_attrs> <new_attrs> <optional list of logical 486N/A# devices whose attributes 486N/A# will need to be changed> 2976N/A# where an <attribute list> := <perm> <user> <group> 5612N/Aaudio:* 0666 root sys 0600 root sys /dev/sound/* 5306N/Avol:volctl 0600 root sys 0666 root sys /dev/volctl 5306N/Asad:user 0600 root sys 0666 root sys /dev/sad/user 3972N/Ase:* 0666 root sys 0600 uucp uucp /dev/cua/* 3978N/Azs:* 0666 root sys 0600 uucp uucp /dev/cua/* 3972N/Asu:* 0666 root sys 0600 uucp uucp /dev/cua/* 3972N/Assd:* 0666 root sys 0640 root sys /dev/dsk/* /dev/rdsk/* 3972N/Adad:* 0600 root sys 0640 root sys /dev/dsk/* /dev/rdsk/* 3972N/Acpc:* 0600 root sys 0666 root sys /devices/pseudo/cpc* 3972N/Alog:conslog 0622 root sys 0666 root sys /dev/conslog 3972N/Asy:tty 0666 root sys 0666 root tty /dev/tty 4103N/Acvc:* 0666 root sys 0600 root sys 4103N/Acvcredir:* 0666 root sys 0600 root sys 5306N/Assm:* 0600 root sys 0640 root sys /devices/ssm*:* 4103N/Aicmp:icmp 0600 root sys 0666 root sys /dev/rawip 4103N/Aicmp6:icmp6 0600 root sys 0666 root sys /dev/rawip6 4103N/Aip:ip 0660 root sys 0666 root sys /dev/ip 4103N/Aip6:ip6 0660 root sys 0666 root sys /dev/ip6 4103N/Arts:rts 0660 root sys 0666 root sys /dev/rts 5306N/Akeysock:keysock 0600 root sys 0666 root sys /dev/keysock 4103N/Aipsecah:ipsecah 0600 root sys 0666 root sys /dev/ipsecah 5306N/Aipsecesp:ipsecesp 0600 root sys 0666 root sys /dev/ipsecesp 4103N/Aspdsock:spdsock 0600 root sys 0666 root sys /dev/spdsock 3972N/Asad:admin 0600 root sys 0666 root sys /dev/sad/admin 3972N/Afssnap:ctl 0600 root sys 0666 root sys /dev/fssnapctl 3972N/Afssnap:* 0600 root sys 0640 root sys /dev/fssnap/* 2976N/Aclone:ce 0600 root sys 0666 root sys /dev/ce 2976N/Aclone:eri 0600 root sys 0666 root sys /dev/eri 2976N/Aclone:ge 0600 root sys 0666 root sys /dev/ge 3824N/Aclone:hme 0600 root sys 0666 root sys /dev/hme 2976N/Aclone:qfe 0600 root sys 0666 root sys /dev/qfe 2976N/Aclone:bge 0600 root sys 0666 root sys /dev/bge 1181N/Aclone:igb 0600 root sys 0666 root sys /dev/igb 2976N/Aclone:ixgbe 0600 root sys 0666 root sys /dev/ixgbe 1181N/Aclone:myri10ge 0600 root sys 0666 root sys /dev/myri10ge 536N/Aclone:rge 0600 root sys 0666 root sys /dev/rge 2976N/Aclone:xge 0600 root sys 0666 root sys /dev/xge 5636N/Aclone:nge 0600 root sys 0666 root sys /dev/nge 961N/Aclone:e1000g 0666 root root 0666 root sys /dev/e1000g 961N/Aclone:chxge 0600 root sys 0666 root sys /dev/chxge 832N/Aclone:vsw 0600 root sys 0666 root sys /dev/vsw 961N/Aclone:vnet 0600 root sys 0666 root sys /dev/vnet 961N/Aclone:pcwl 0600 root sys 0666 root sys /dev/pcwl 961N/Aclone:pcan 0600 root sys 0666 root sys /dev/pcan 961N/Aclone:afe 0600 root sys 0666 root sys /dev/afe 2296N/Aclone:mxfe 0600 root sys 0666 root sys /dev/mxfe 961N/Aclone:rtls 0600 root sys 0666 root sys /dev/rtls 961N/Abge:* 0600 root sys 0666 root sys /dev/bge* 961N/Aigb:* 0600 root sys 0666 root sys /dev/igb* 961N/Aixgbe:* 0600 root sys 0666 root sys /dev/ixgbe* 961N/Amyri10ge:* 0600 root sys 0666 root sys /dev/myri10ge* 486N/Arge:* 0600 root sys 0666 root sys /dev/rge* 857N/Axge:* 0600 root sys 0666 root sys /dev/xge* 961N/Ange:* 0600 root sys 0666 root sys /dev/nge* 2296N/Ae1000g:* 0666 root root 0666 root sys /dev/e1000g* 961N/Achxge:* 0600 root sys 0666 root sys /dev/chxge* 961N/Avsw:* 0600 root sys 0666 root sys /dev/vsw* 961N/Avnet:* 0600 root sys 0666 root sys /dev/vnet* 486N/Apcwl:* 0600 root sys 0666 root sys /dev/pcwl* 961N/Apcan:* 0600 root sys 0666 root sys /dev/pcan* 961N/Aclone:dmfe 0600 root sys 0666 root sys /dev/dmfe 2296N/Admfe:* 0600 root sys 0666 root sys /dev/dmfe* 2296N/Aafe:* 0600 root sys 0666 root sys /dev/afe* 2296N/Amxfe:* 0600 root sys 0666 root sys /dev/mxfe* 2296N/Artls:* 0600 root sys 0666 root sys /dev/rtls* 961N/Aipf:* 0600 root sys 0666 root sys /dev/ipf 961N/Apfil:* 0600 root sys 0666 root sys /dev/pfil 486N/Ascsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl 961N/Afbt:fbt 0600 root sys 0644 root sys /dev/dtrace/provider/fbt 961N/Alockstat:* 0600 root sys 0644 root sys /dev/dtrace/provider/lockstat 961N/Aprofile:profile 0600 root sys 0644 root sys /dev/dtrace/provider/profile 961N/Asdt:sdt 0600 root sys 0644 root sys /dev/dtrace/provider/sdt 961N/Asystrace:systrace 0600 root sys 0644 root sys /dev/dtrace/provider/systrace 2296N/A# <device>:<minor> <optional list of logical devices to be deleted> 961N/Amm:mbio /dev/mbio /devices/pseudo/mm:mbio 832N/Amm:mbmem /dev/mbmem /devices/pseudo/mm:mbmem 5636N/A# field of the entry to the list created by this function. The 2296N/A# 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.