]>
Commit | Line | Data |
---|---|---|
657376c6 | 1 | Index: squid/src/acl.c |
2 | diff -c squid/src/acl.c:1.270.2.34 squid/src/acl.c:1.270.2.35 | |
3 | *** squid/src/acl.c:1.270.2.34 Sun Feb 20 12:07:45 2005 | |
4 | --- squid/src/acl.c Fri Mar 4 09:22:16 2005 | |
5 | *************** | |
6 | *** 361,367 **** | |
7 | case 4: /* a dotted quad */ | |
8 | if (!safe_inet_addr(asc, addr)) { | |
9 | debug(28, 0) ("decode_addr: unsafe IP address: '%s'\n", asc); | |
10 | ! fatal("decode_addr: unsafe IP address"); | |
11 | } | |
12 | break; | |
13 | case 1: /* a significant bits value for a mask */ | |
14 | --- 361,367 ---- | |
15 | case 4: /* a dotted quad */ | |
16 | if (!safe_inet_addr(asc, addr)) { | |
17 | debug(28, 0) ("decode_addr: unsafe IP address: '%s'\n", asc); | |
18 | ! self_destruct(); | |
19 | } | |
20 | break; | |
21 | case 1: /* a significant bits value for a mask */ | |
22 | *************** | |
23 | *** 557,565 **** | |
24 | } else { | |
25 | /* assume its time-of-day spec */ | |
26 | if (sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) { | |
27 | ! fatalf("aclParseTimeSpec: ERROR: Bad time range in" | |
28 | "%s line %d: %s\n", | |
29 | cfg_filename, config_lineno, config_input_line); | |
30 | } | |
31 | q = memAllocate(MEM_ACL_TIME_DATA); | |
32 | q->start = h1 * 60 + m1; | |
33 | --- 557,566 ---- | |
34 | } else { | |
35 | /* assume its time-of-day spec */ | |
36 | if (sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) { | |
37 | ! debug(28, 0) ("aclParseTimeSpec: ERROR: Bad time range in" | |
38 | "%s line %d: %s\n", | |
39 | cfg_filename, config_lineno, config_input_line); | |
40 | + self_destruct(); | |
41 | } | |
42 | q = memAllocate(MEM_ACL_TIME_DATA); | |
43 | q->start = h1 * 60 + m1; | |
44 | *************** | |
45 | *** 567,575 **** | |
46 | q->weekbits = weekbits; | |
47 | weekbits = 0; | |
48 | if (q->start > q->stop) { | |
49 | ! fatalf("aclParseTimeSpec: ERROR: Reversed time range in" | |
50 | "%s line %d: %s\n", | |
51 | cfg_filename, config_lineno, config_input_line); | |
52 | } | |
53 | if (q->weekbits == 0) | |
54 | q->weekbits = ACL_ALLWEEK; | |
55 | --- 568,577 ---- | |
56 | q->weekbits = weekbits; | |
57 | weekbits = 0; | |
58 | if (q->start > q->stop) { | |
59 | ! debug(28, 0) ("aclParseTimeSpec: ERROR: Reversed time range in" | |
60 | "%s line %d: %s\n", | |
61 | cfg_filename, config_lineno, config_input_line); | |
62 | + self_destruct(); | |
63 | } | |
64 | if (q->weekbits == 0) | |
65 | q->weekbits = ACL_ALLWEEK; | |
66 | *************** | |
67 | *** 787,809 **** | |
68 | ||
69 | /* snarf the ACL name */ | |
70 | if ((t = strtok(NULL, w_space)) == NULL) { | |
71 | - debug(28, 0) ("%s line %d: %s\n", | |
72 | - cfg_filename, config_lineno, config_input_line); | |
73 | debug(28, 0) ("aclParseAclLine: missing ACL name.\n"); | |
74 | ! return; | |
75 | } | |
76 | xstrncpy(aclname, t, ACL_NAME_SZ); | |
77 | /* snarf the ACL type */ | |
78 | if ((t = strtok(NULL, w_space)) == NULL) { | |
79 | - debug(28, 0) ("%s line %d: %s\n", | |
80 | - cfg_filename, config_lineno, config_input_line); | |
81 | debug(28, 0) ("aclParseAclLine: missing ACL type.\n"); | |
82 | return; | |
83 | } | |
84 | if ((acltype = aclStrToType(t)) == ACL_NONE) { | |
85 | - debug(28, 0) ("%s line %d: %s\n", | |
86 | - cfg_filename, config_lineno, config_input_line); | |
87 | debug(28, 0) ("aclParseAclLine: Invalid ACL type '%s'\n", t); | |
88 | return; | |
89 | } | |
90 | if ((A = aclFindByName(aclname)) == NULL) { | |
91 | --- 789,807 ---- | |
92 | ||
93 | /* snarf the ACL name */ | |
94 | if ((t = strtok(NULL, w_space)) == NULL) { | |
95 | debug(28, 0) ("aclParseAclLine: missing ACL name.\n"); | |
96 | ! self_destruct(); | |
97 | } | |
98 | xstrncpy(aclname, t, ACL_NAME_SZ); | |
99 | /* snarf the ACL type */ | |
100 | if ((t = strtok(NULL, w_space)) == NULL) { | |
101 | debug(28, 0) ("aclParseAclLine: missing ACL type.\n"); | |
102 | + self_destruct(); | |
103 | return; | |
104 | } | |
105 | if ((acltype = aclStrToType(t)) == ACL_NONE) { | |
106 | debug(28, 0) ("aclParseAclLine: Invalid ACL type '%s'\n", t); | |
107 | + self_destruct(); | |
108 | return; | |
109 | } | |
110 | if ((A = aclFindByName(aclname)) == NULL) { | |
111 | *************** | |
112 | *** 815,821 **** | |
113 | new_acl = 1; | |
114 | } else { | |
115 | if (acltype != A->type) { | |
116 | ! debug(28, 0) ("aclParseAclLine: ACL '%s' already exists with different type, skipping.\n", A->name); | |
117 | return; | |
118 | } | |
119 | debug(28, 3) ("aclParseAclLine: Appending to '%s'\n", aclname); | |
120 | --- 813,820 ---- | |
121 | new_acl = 1; | |
122 | } else { | |
123 | if (acltype != A->type) { | |
124 | ! debug(28, 0) ("aclParseAclLine: ACL '%s' already exists with different type.\n", A->name); | |
125 | ! self_destruct(); | |
126 | return; | |
127 | } | |
128 | debug(28, 3) ("aclParseAclLine: Appending to '%s'\n", aclname); | |
129 | *************** | |
130 | *** 887,908 **** | |
131 | break; | |
132 | case ACL_PROXY_AUTH: | |
133 | if (authenticateSchemeCount() == 0) { | |
134 | ! fatalf("Invalid Proxy Auth ACL '%s' " | |
135 | "because no authentication schemes were compiled.\n", A->cfgline); | |
136 | } else if (authenticateActiveSchemeCount() == 0) { | |
137 | ! fatalf("Invalid Proxy Auth ACL '%s' " | |
138 | "because no authentication schemes are fully configured.\n", A->cfgline); | |
139 | } else { | |
140 | aclParseUserList(&A->data); | |
141 | } | |
142 | break; | |
143 | case ACL_PROXY_AUTH_REGEX: | |
144 | if (authenticateSchemeCount() == 0) { | |
145 | ! fatalf("Invalid Proxy Auth ACL '%s' " | |
146 | "because no authentication schemes were compiled.\n", A->cfgline); | |
147 | } else if (authenticateActiveSchemeCount() == 0) { | |
148 | ! fatalf("Invalid Proxy Auth ACL '%s' " | |
149 | "because no authentication schemes are fully configured.\n", A->cfgline); | |
150 | } else { | |
151 | aclParseRegexList(&A->data); | |
152 | } | |
153 | --- 886,911 ---- | |
154 | break; | |
155 | case ACL_PROXY_AUTH: | |
156 | if (authenticateSchemeCount() == 0) { | |
157 | ! debug(28, 0) ("Invalid Proxy Auth ACL '%s' " | |
158 | "because no authentication schemes were compiled.\n", A->cfgline); | |
159 | + self_destruct(); | |
160 | } else if (authenticateActiveSchemeCount() == 0) { | |
161 | ! debug(28, 0) ("Invalid Proxy Auth ACL '%s' " | |
162 | "because no authentication schemes are fully configured.\n", A->cfgline); | |
163 | + self_destruct(); | |
164 | } else { | |
165 | aclParseUserList(&A->data); | |
166 | } | |
167 | break; | |
168 | case ACL_PROXY_AUTH_REGEX: | |
169 | if (authenticateSchemeCount() == 0) { | |
170 | ! debug(28, 0) ("Invalid Proxy Auth ACL '%s' " | |
171 | "because no authentication schemes were compiled.\n", A->cfgline); | |
172 | + self_destruct(); | |
173 | } else if (authenticateActiveSchemeCount() == 0) { | |
174 | ! debug(28, 0) ("Invalid Proxy Auth ACL '%s' " | |
175 | "because no authentication schemes are fully configured.\n", A->cfgline); | |
176 | + self_destruct(); | |
177 | } else { | |
178 | aclParseRegexList(&A->data); | |
179 | } | |
180 | *************** | |
181 | *** 1091,1099 **** | |
182 | debug(28, 3) ("aclParseAccessLine: looking for ACL name '%s'\n", t); | |
183 | a = aclFindByName(t); | |
184 | if (a == NULL) { | |
185 | ! debug(28, 0) ("%s line %d: %s\n", | |
186 | ! cfg_filename, config_lineno, config_input_line); | |
187 | ! debug(28, 0) ("aclParseAccessLine: ACL name '%s' not found.\n", t); | |
188 | memFree(L, MEM_ACL_LIST); | |
189 | continue; | |
190 | } | |
191 | --- 1094,1101 ---- | |
192 | debug(28, 3) ("aclParseAccessLine: looking for ACL name '%s'\n", t); | |
193 | a = aclFindByName(t); | |
194 | if (a == NULL) { | |
195 | ! debug(28, 0) ("ACL name '%s' not defined!\n", t); | |
196 | ! self_destruct(); | |
197 | memFree(L, MEM_ACL_LIST); | |
198 | continue; | |
199 | } | |
200 | *************** | |
201 | *** 1329,1335 **** | |
202 | debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max); | |
203 | return; | |
204 | error: | |
205 | ! fatal("aclParseUserMaxIP: Malformed ACL %d\n"); | |
206 | } | |
207 | ||
208 | void | |
209 | --- 1331,1337 ---- | |
210 | debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max); | |
211 | return; | |
212 | error: | |
213 | ! self_destruct(); | |
214 | } | |
215 | ||
216 | void | |
217 | Index: squid/src/cache_cf.c | |
218 | diff -c squid/src/cache_cf.c:1.396.2.20 squid/src/cache_cf.c:1.396.2.21 | |
219 | *** squid/src/cache_cf.c:1.396.2.20 Sun Feb 20 19:55:04 2005 | |
220 | --- squid/src/cache_cf.c Fri Mar 4 09:22:16 2005 | |
221 | *************** | |
222 | *** 110,115 **** | |
223 | --- 110,116 ---- | |
224 | void | |
225 | self_destruct(void) | |
226 | { | |
227 | + shutting_down = 1; | |
228 | fatalf("Bungled %s line %d: %s", | |
229 | cfg_filename, config_lineno, config_input_line); | |
230 | } | |
231 | Index: squid/src/tools.c | |
232 | diff -c squid/src/tools.c:1.213.2.11 squid/src/tools.c:1.213.2.12 | |
233 | *** squid/src/tools.c:1.213.2.11 Sun Feb 13 14:19:44 2005 | |
234 | --- squid/src/tools.c Fri Mar 4 09:22:16 2005 | |
235 | *************** | |
236 | *** 341,348 **** | |
237 | fprintf(debug_log, "Squid Cache (Version %s): Terminated abnormally.\n", | |
238 | version_string); | |
239 | fflush(debug_log); | |
240 | ! PrintRusage(); | |
241 | ! dumpMallocStats(); | |
242 | } | |
243 | ||
244 | /* fatal */ | |
245 | --- 341,350 ---- | |
246 | fprintf(debug_log, "Squid Cache (Version %s): Terminated abnormally.\n", | |
247 | version_string); | |
248 | fflush(debug_log); | |
249 | ! if (!shutting_down) { | |
250 | ! PrintRusage(); | |
251 | ! dumpMallocStats(); | |
252 | ! } | |
253 | } | |
254 | ||
255 | /* fatal */ | |
256 | *************** | |
257 | *** 357,363 **** | |
258 | storeDirWriteCleanLogs(0); | |
259 | fatal_common(message); | |
260 | if (shutting_down) | |
261 | ! exit(0); | |
262 | else | |
263 | abort(); | |
264 | } | |
265 | --- 359,365 ---- | |
266 | storeDirWriteCleanLogs(0); | |
267 | fatal_common(message); | |
268 | if (shutting_down) | |
269 | ! exit(1); | |
270 | else | |
271 | abort(); | |
272 | } |