author | ericheng |
Thu, 13 Apr 2006 11:40:49 -0700 | |
changeset 1804 | 102112240ff7 |
parent 907 | 23d918baa212 |
child 2419 | 8f63c8665c13 |
permissions | -rw-r--r-- |
0 | 1 |
#!/bin/sh |
2 |
# |
|
3 |
# CDDL HEADER START |
|
4 |
# |
|
5 |
# The contents of this file are subject to the terms of the |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
0 | 8 |
# |
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
# or http://www.opensolaris.org/os/licensing. |
|
11 |
# See the License for the specific language governing permissions |
|
12 |
# and limitations under the License. |
|
13 |
# |
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
# |
|
20 |
# CDDL HEADER END |
|
21 |
# |
|
22 |
# |
|
23 |
# ident "%Z%%M% %I% %E% SMI" |
|
24 |
# |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
25 |
# Copyright 2006 Sun Microsystems, Inc. All rights reserved. |
0 | 26 |
# Use is subject to license terms. |
27 |
# |
|
28 |
# NOTE: When a change is made to the source file for |
|
29 |
# /etc/security/device_policy a corresponding change must be made to |
|
30 |
# this class-action script. |
|
31 |
# |
|
32 |
while read src dest |
|
33 |
do |
|
34 |
if [ ! -f $dest ] ; then |
|
35 |
cp $src $dest |
|
36 |
continue |
|
37 |
fi |
|
38 |
||
39 |
# changes |
|
40 |
cp $dest $dest.$$ |
|
41 |
sed < $dest.$$ > $dest \ |
|
42 |
-e '/md:admin/s/read_priv_set=sys_config/ /' \ |
|
43 |
-e '/^[sm]d[: ]/d' \ |
|
44 |
-e '/^ssd[: ]/d' \ |
|
45 |
-e '/^fssnap:\* /d' \ |
|
46 |
-e '/^icmp[ ]*read_priv_set=net_rawaccess[ ]*write_priv_set=net_rawaccess$/d' \ |
|
47 |
-e '/^icmp6[ ]*read_priv_set=net_rawaccess[ ]*write_priv_set=net_rawaccess$/d' |
|
48 |
||
49 |
rm -f $dest.$$ |
|
50 |
||
51 |
# potential additions |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
52 |
additions="aggr aggr:ctl bge dld:ctl dnet ibd icmp icmp6 openeepr random vni ipf pfil scsi_vhci" |
0 | 53 |
|
54 |
for dev in $additions |
|
55 |
do |
|
56 |
# if an entry for this driver exists in the source |
|
57 |
# file... |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
58 |
grep "$dev[ ]" $src > /dev/null 2>&1 |
0 | 59 |
if [ $? = 0 ] ; then |
60 |
# ...and no entry exists in the destination |
|
61 |
# file... |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
62 |
grep "$dev[ ]" $dest > /dev/null 2>&1 |
0 | 63 |
if [ $? != 0 ] ; then |
64 |
# ...then add the entry from |
|
65 |
# the source file to the |
|
66 |
# destination file. |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
67 |
grep "$dev[ ]" $src >> $dest |
0 | 68 |
fi |
69 |
fi |
|
70 |
done |
|
71 |
||
72 |
# potential deletions |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
73 |
deletions="elx dld" |
0 | 74 |
|
75 |
for dev in $deletions |
|
76 |
do |
|
77 |
# if an entry for this driver exists in the destination |
|
78 |
# file... |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
79 |
grep "$dev[ ]" $dest > /dev/null 2>&1 |
0 | 80 |
if [ $? = 0 ] ; then |
81 |
# ...and no entry exists in the source |
|
82 |
# file... |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
83 |
grep "$dev[ ]" $src > /dev/null 2>&1 |
0 | 84 |
if [ $? != 0 ] ; then |
85 |
# ...then remove the entry from |
|
86 |
# the destination file. |
|
87 |
cp $dest $dest.$$ |
|
1804
102112240ff7
6312408 DDI_NT_MAC macro definition should be removed
ericheng
parents:
907
diff
changeset
|
88 |
grep -v "$dev[ ]" $dest.$$ > $dest |
0 | 89 |
rm -f $dest.$$ |
90 |
fi |
|
91 |
fi |
|
92 |
done |
|
93 |
done |
|
94 |
||
95 |
exit 0 |