summaryrefslogtreecommitdiff
blob: b810323a2bb81c78838859ec4c5dec1fa0b08f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
--- firehol.sh	2004-05-03 00:51:38.000000000 +0200
+++ firehol.sh.new	2004-08-01 23:16:42.390810920 +0200
@@ -1788,7 +1788,7 @@
 	local prface="${work_inface}"
 	
 	local pre="pr"
-	unset reverse
+	local reverse=
 	if [ "${1}" = "reverse" ]
 	then
 		local reverse="reverse"	# needed to recursion
@@ -2691,7 +2691,7 @@
 				action="${2}"
 				shift 2
 				
-				unset action_param
+				local -a action_param=()
 				local action_is_chain=0
 				case "${action}" in
 					accept|ACCEPT)
@@ -3287,7 +3287,7 @@
 			local pr=
 			for pr in ${proto}
 			do
-				unset proto_arg
+				local -a proto_arg=()
 				
 				case ${pr} in
 					any|ANY)
@@ -3299,7 +3299,7 @@
 				esac
 				
 				rule_action_param "${negative_action}" "${pr}" "${action_param[@]}" -- ${table} -A "${negative_chain}" "${proto_arg[@]}"
-				unset action_param
+				local -a action_param=()
 			done
 		fi
 	fi
@@ -3311,8 +3311,8 @@
 	local tuid=
 	for tuid in ${uid}
 	do
-		unset uid_arg
-		unset owner_arg
+		local -a uid_arg=()
+		local -a owner_arg=()
 		
 		case ${tuid} in
 			any|ANY)
@@ -3327,7 +3327,7 @@
 		local tgid=
 		for tgid in ${gid}
 		do
-			unset gid_arg
+			local -a gid_arg=()
 			
 			case ${tgid} in
 				any|ANY)
@@ -3342,7 +3342,7 @@
 			local tpid=
 			for tpid in ${pid}
 			do
-				unset pid_arg
+				local -a pid_arg=()
 				
 				case ${tpid} in
 					any|ANY)
@@ -3357,7 +3357,7 @@
 				local tsid=
 				for tsid in ${sid}
 				do
-					unset sid_arg
+					local -a sid_arg=()
 					
 					case ${tsid} in
 						any|ANY)
@@ -3372,7 +3372,7 @@
 					local tcmd=
 					for tcmd in ${cmd}
 					do
-						unset cmd_arg
+						local -a cmd_arg=()
 						
 						case ${tcmd} in
 							any|ANY)
@@ -3387,7 +3387,7 @@
 						local pr=
 						for pr in ${proto}
 						do
-							unset proto_arg
+							local -a proto_arg=()
 							
 							case ${pr} in
 								any|ANY)
@@ -3401,7 +3401,7 @@
 							local inf=
 							for inf in ${inface}
 							do
-								unset inf_arg
+								local -a inf_arg=()
 								case ${inf} in
 									any|ANY)
 										;;
@@ -3414,7 +3414,7 @@
 								local outf=
 								for outf in ${outface}
 								do
-									unset outf_arg
+									local -a outf_arg=()
 									case ${outf} in
 										any|ANY)
 											;;
@@ -3427,7 +3427,7 @@
 									local inph=
 									for inph in ${physin}
 									do
-										unset inph_arg
+										local -a inph_arg=()
 										case ${inph} in
 											any|ANY)
 												;;
@@ -3441,7 +3441,7 @@
 										local outph=
 										for outph in ${physout}
 										do
-											unset outph_arg
+											local -a outph_arg=()
 											case ${outph} in
 												any|ANY)
 													;;
@@ -3455,7 +3455,7 @@
 											local sp=
 											for sp in ${sport}
 											do
-												unset sp_arg
+												local -a sp_arg=()
 												case ${sp} in
 													any|ANY)
 													;;
@@ -3468,7 +3468,7 @@
 												local dp=
 												for dp in ${dport}
 												do
-													unset dp_arg
+													local -a dp_arg=()
 													case ${dp} in
 														any|ANY)
 															;;
@@ -3481,7 +3481,7 @@
 													local mc=
 													for mc in ${mac}
 													do
-														unset mc_arg
+														local -a mc_arg=()
 														case ${mc} in
 															any|ANY)
 																;;
@@ -3494,7 +3494,7 @@
 														local s=
 														for s in ${src}
 														do
-															unset s_arg
+															local -a s_arg=()
 															case ${s} in
 																any|ANY)
 																	;;
@@ -3507,7 +3507,7 @@
 															local d=
 															for d in ${dst}
 															do
-																unset d_arg
+																local -a d_arg=()
 																case ${d} in
 																	any|ANY)
 																		;;
@@ -3517,19 +3517,19 @@
 																		;;
 																esac
 																
-																unset state_arg
+																local -a state_arg=()
 																if [ ! -z "${state}" ]
 																then
 																	local -a state_arg=("-m" "state" "${statenot}" "--state" "${state}")
 																fi
 																
-																unset limit_arg
+																local -a limit_arg=()
 																if [ ! -z "${limit}" ]
 																then
 																	local -a limit_arg=("-m" "limit" "--limit" "${limit}" "--limit-burst" "${burst}")
 																fi
 																
-																unset iplimit_arg
+																local -a iplimit_arg=()
 																if [ ! -z "${iplimit}" ]
 																then
 																	local -a iplimit_arg=("-m" "iplimit" "--iplimit-above" "${iplimit}" "--iplimit-mask" "${iplimit_mask}")
@@ -3537,7 +3537,7 @@
 																
 																declare -a basecmd=("${inf_arg[@]}" "${outf_arg[@]}" "${physdev_arg[@]}" "${inph_arg[@]}" "${outph_arg[@]}" "${limit_arg[@]}" "${iplimit_arg[@]}" "${proto_arg[@]}" "${s_arg[@]}" "${sp_arg[@]}" "${d_arg[@]}" "${dp_arg[@]}" "${owner_arg[@]}" "${uid_arg[@]}" "${gid_arg[@]}" "${pid_arg[@]}" "${sid_arg[@]}" "${cmd_arg[@]}" "${state_arg[@]}" "${mc_arg[@]}")
 																
-																unset logopts_arg
+																local -a logopts_arg=()
 																if [ "${FIREHOL_LOG_MODE}" = "ULOG" ]
 																then
 																	local -a logopts_arg=("--ulog-prefix='${logtxt}:'")
@@ -4822,10 +4822,8 @@
 			# find all the networks this IP can access directly
 			# or through its peer
 			netcount=0
-			unset ifnets
-			unset ofnets
-			set -a ifnets=
-			set -a ofnets=
+			ifnets=
+			ofnets=
 			for net in ${nets}
 			do
 				test "${net}" = "default" && continue