]>
Commit | Line | Data |
---|---|---|
f6f70ac5 ER |
1 | --- nagios-3.0.3/cgi/avail.c 2008-06-23 23:47:42.000000000 +0300 |
2 | +++ nagios-3.0.3-cgi/cgi/avail.c 2008-10-11 12:34:44.496658785 +0300 | |
3 | @@ -37,6 +37,8 @@ | |
4 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
5 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
6 | ||
7 | +extern char *http_charset; | |
8 | + | |
9 | extern host *host_list; | |
10 | extern hostgroup *hostgroup_list; | |
11 | extern servicegroup *servicegroup_list; | |
12 | @@ -1079,9 +1081,9 @@ | |
13 | printf("Expires: %s\r\n",date_time); | |
14 | ||
15 | if(output_format==HTML_OUTPUT) | |
16 | - printf("Content-type: text/html\r\n\r\n"); | |
17 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
18 | else{ | |
19 | - printf("Content-type: text/plain\r\n\r\n"); | |
20 | + printf("Content-type: text/plain; charset=\"%s\"\r\n\r\n", http_charset); | |
21 | return; | |
22 | } | |
23 | ||
24 | --- nagios-3.0.3/cgi/cgiutils.c 2008-06-23 23:47:44.000000000 +0300 | |
25 | +++ nagios-3.0.3-cgi/cgi/cgiutils.c 2008-10-11 12:34:44.472657400 +0300 | |
26 | @@ -55,6 +55,7 @@ | |
27 | char *statuswrl_include=NULL; | |
28 | ||
29 | char *illegal_output_chars=NULL; | |
30 | +char *http_charset=NULL; | |
31 | ||
32 | char *notes_url_target=NULL; | |
33 | char *action_url_target=NULL; | |
34 | @@ -188,6 +189,9 @@ | |
35 | host_unreachable_sound=NULL; | |
36 | normal_sound=NULL; | |
37 | ||
38 | + my_free(http_charset); | |
39 | + http_charset = strdup(DEFAULT_HTTP_CHARSET); | |
40 | + | |
41 | statusmap_background_image=NULL; | |
42 | statuswrl_include=NULL; | |
43 | ||
44 | @@ -391,6 +395,9 @@ | |
45 | else if(!strcmp(var,"illegal_macro_output_chars")) | |
46 | illegal_output_chars=strdup(val); | |
47 | ||
48 | + else if(!strcmp(var,"http_charset")) | |
49 | + http_charset=strdup(val); | |
50 | + | |
51 | else if(!strcmp(var,"notes_url_target")) | |
52 | notes_url_target=strdup(val); | |
53 | ||
54 | --- nagios-3.0.3/cgi/cmd.c 2008-05-19 21:42:26.000000000 +0300 | |
55 | +++ nagios-3.0.3-cgi/cgi/cmd.c 2008-10-11 12:34:44.496658785 +0300 | |
56 | @@ -39,6 +39,8 @@ | |
57 | ||
58 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
59 | ||
60 | +extern char *http_charset; | |
61 | + | |
62 | extern int nagios_process_state; | |
63 | ||
64 | extern int check_external_commands; | |
65 | @@ -235,7 +237,7 @@ | |
66 | ||
67 | if(content_type==WML_CONTENT){ | |
68 | ||
69 | - printf("Content-type: text/vnd.wap.wml\r\n\r\n"); | |
70 | + printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset); | |
71 | ||
72 | printf("<?xml version=\"1.0\"?>\n"); | |
73 | printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); | |
74 | @@ -247,7 +249,7 @@ | |
75 | ||
76 | else{ | |
77 | ||
78 | - printf("Content-type: text/html\r\n\r\n"); | |
79 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
80 | ||
81 | printf("<html>\n"); | |
82 | printf("<head>\n"); | |
83 | --- nagios-3.0.3/cgi/config.c 2008-04-13 21:34:27.000000000 +0300 | |
84 | +++ nagios-3.0.3-cgi/cgi/config.c 2008-10-11 12:34:44.496658785 +0300 | |
85 | @@ -37,6 +37,8 @@ | |
86 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
87 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
88 | ||
89 | +extern char *http_charset; | |
90 | + | |
91 | extern host *host_list; | |
92 | extern service *service_list; | |
93 | extern hostgroup *hostgroup_list; | |
94 | @@ -293,7 +295,7 @@ | |
95 | printf("Pragma: no-cache\r\n"); | |
96 | printf("Last-Modified: %s\r\n",date_time); | |
97 | printf("Expires: %s\r\n",date_time); | |
98 | - printf("Content-type: text/html\r\n\r\n"); | |
99 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
100 | ||
101 | printf("<html>\n"); | |
102 | printf("<head>\n"); | |
103 | --- nagios-3.0.3/cgi/extinfo.c 2008-01-24 04:51:30.000000000 +0200 | |
104 | +++ nagios-3.0.3-cgi/cgi/extinfo.c 2008-10-11 12:34:44.500659016 +0300 | |
105 | @@ -38,6 +38,8 @@ | |
106 | extern int nagios_process_state; | |
107 | extern int refresh_rate; | |
108 | ||
109 | +extern char *http_charset; | |
110 | + | |
111 | extern time_t program_start; | |
112 | extern int nagios_pid; | |
113 | extern int daemon_mode; | |
114 | @@ -584,7 +586,7 @@ | |
115 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
116 | printf("Expires: %s\r\n",date_time); | |
117 | ||
118 | - printf("Content-type: text/html\r\n\r\n"); | |
119 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
120 | ||
121 | if(embedded==TRUE) | |
122 | return; | |
123 | --- nagios-3.0.3/cgi/histogram.c 2008-05-19 21:42:26.000000000 +0300 | |
124 | +++ nagios-3.0.3-cgi/cgi/histogram.c 2008-10-11 12:34:44.512659708 +0300 | |
125 | @@ -130,6 +130,8 @@ | |
126 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
127 | extern char physical_images_path[MAX_FILENAME_LENGTH]; | |
128 | ||
129 | +extern char *http_charset; | |
130 | + | |
131 | extern int log_rotation_method; | |
132 | ||
133 | extern host *host_list; | |
134 | @@ -994,7 +996,7 @@ | |
135 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
136 | printf("Expires: %s\r\n",date_time); | |
137 | ||
138 | - printf("Content-type: text/html\r\n\r\n"); | |
139 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
140 | ||
141 | if(embedded==TRUE) | |
142 | return; | |
2b46b6f0 ER |
143 | --- nagios-3.0.3-cgi/cgi/history.c 2008-10-11 12:34:44.480657862 +0300 |
144 | +++ nagios-3.0.3/cgi/history.c 2008-10-11 12:38:12.164637148 +0300 | |
145 | @@ -57,6 +57,8 @@ | |
146 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
147 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
148 | ||
149 | +extern char *http_charset; | |
150 | + | |
151 | extern int log_rotation_method; | |
152 | ||
153 | extern int enable_splunk_integration; | |
154 | @@ -315,7 +317,7 @@ | |
f6f70ac5 ER |
155 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); |
156 | printf("Expires: %s\r\n",date_time); | |
157 | ||
158 | - printf("Content-type: text/html\r\n\r\n"); | |
159 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
160 | ||
161 | if(embedded==TRUE) | |
162 | return; | |
163 | --- nagios-3.0.3/cgi/notifications.c 2008-05-19 21:42:27.000000000 +0300 | |
164 | +++ nagios-3.0.3-cgi/cgi/notifications.c 2008-10-11 12:34:44.500659016 +0300 | |
165 | @@ -37,6 +37,8 @@ | |
166 | extern char url_docs_path[MAX_FILENAME_LENGTH]; | |
167 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
168 | ||
169 | +extern char *http_charset; | |
170 | + | |
171 | extern int log_rotation_method; | |
172 | ||
173 | ||
174 | @@ -303,7 +305,7 @@ | |
175 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
176 | printf("Expires: %s\r\n",date_time); | |
177 | ||
178 | - printf("Content-type: text/html\r\n\r\n"); | |
179 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
180 | ||
181 | if(embedded==TRUE) | |
182 | return; | |
183 | --- nagios-3.0.3/cgi/outages.c 2008-01-09 19:51:23.000000000 +0200 | |
184 | +++ nagios-3.0.3-cgi/cgi/outages.c 2008-10-11 12:34:44.500659016 +0300 | |
185 | @@ -39,6 +39,8 @@ | |
186 | extern hoststatus *hoststatus_list; | |
187 | extern servicestatus *servicestatus_list; | |
188 | ||
189 | +extern char *http_charset; | |
190 | + | |
191 | extern char main_config_file[MAX_FILENAME_LENGTH]; | |
192 | extern char url_html_path[MAX_FILENAME_LENGTH]; | |
193 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
194 | @@ -215,7 +217,7 @@ | |
195 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
196 | printf("Expires: %s\r\n",date_time); | |
197 | ||
198 | - printf("Content-type: text/html\r\n\r\n"); | |
199 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
200 | ||
201 | if(embedded==TRUE) | |
202 | return; | |
203 | --- nagios-3.0.3/cgi/showlog.c 2008-01-09 19:51:23.000000000 +0200 | |
204 | +++ nagios-3.0.3-cgi/cgi/showlog.c 2008-10-11 12:34:44.500659016 +0300 | |
205 | @@ -37,6 +37,8 @@ | |
206 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
207 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
208 | ||
209 | +extern char *http_charset; | |
210 | + | |
211 | extern int log_rotation_method; | |
212 | ||
213 | extern int enable_splunk_integration; | |
214 | @@ -188,7 +190,7 @@ | |
215 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
216 | printf("Expires: %s\r\n",date_time); | |
217 | ||
218 | - printf("Content-type: text/html\r\n\r\n"); | |
219 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
220 | ||
221 | if(embedded==TRUE) | |
222 | return; | |
223 | --- nagios-3.0.3/cgi/status.c 2008-06-23 23:47:46.000000000 +0300 | |
224 | +++ nagios-3.0.3-cgi/cgi/status.c 2008-10-11 12:34:44.504659246 +0300 | |
225 | @@ -44,6 +44,8 @@ | |
226 | extern char url_media_path[MAX_FILENAME_LENGTH]; | |
227 | extern char log_file[MAX_FILENAME_LENGTH]; | |
228 | ||
229 | +extern char *http_charset; | |
230 | + | |
231 | extern char *service_critical_sound; | |
232 | extern char *service_warning_sound; | |
233 | extern char *service_unknown_sound; | |
234 | @@ -503,7 +505,7 @@ | |
235 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
236 | printf("Expires: %s\r\n",date_time); | |
237 | ||
238 | - printf("Content-type: text/html\r\n\r\n"); | |
239 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
240 | ||
241 | if(embedded==TRUE) | |
242 | return; | |
243 | --- nagios-3.0.3/cgi/statusmap.c 2008-05-19 21:42:28.000000000 +0300 | |
244 | +++ nagios-3.0.3-cgi/cgi/statusmap.c 2008-10-11 12:34:44.508659477 +0300 | |
245 | @@ -54,6 +54,8 @@ | |
246 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
247 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
248 | ||
249 | +extern char *http_charset; | |
250 | + | |
251 | extern host *host_list; | |
252 | extern hostgroup *hostgroup_list; | |
253 | extern service *service_list; | |
254 | @@ -320,7 +322,7 @@ | |
255 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
256 | printf("Expires: %s\r\n",date_time); | |
257 | ||
258 | - printf("Content-Type: text/html\r\n\r\n"); | |
259 | + printf("Content-Type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
260 | ||
261 | if(embedded==TRUE) | |
262 | return; | |
263 | --- nagios-3.0.3/cgi/statuswml.c 2008-05-19 21:42:28.000000000 +0300 | |
264 | +++ nagios-3.0.3-cgi/cgi/statuswml.c 2008-10-11 12:34:44.504659246 +0300 | |
66b4f57f | 265 | @@ -47,6 +47,8 @@ |
f6f70ac5 | 266 | |
66b4f57f AM |
267 | extern char *ping_syntax; |
268 | ||
269 | +extern char *http_charset; | |
f6f70ac5 | 270 | + |
66b4f57f AM |
271 | #define DISPLAY_HOST 0 |
272 | #define DISPLAY_SERVICE 1 | |
273 | #define DISPLAY_HOSTGROUP 2 | |
f6f70ac5 ER |
274 | @@ -193,7 +195,7 @@ |
275 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
276 | printf("Expires: %s\r\n",date_time); | |
277 | ||
278 | - printf("Content-type: text/vnd.wap.wml\r\n\r\n"); | |
279 | + printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset); | |
280 | ||
281 | printf("<?xml version=\"1.0\"?>\n"); | |
282 | printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); | |
283 | --- nagios-3.0.3/cgi/statuswrl.c 2007-07-16 19:41:46.000000000 +0300 | |
284 | +++ nagios-3.0.3-cgi/cgi/statuswrl.c 2008-10-11 12:34:44.508659477 +0300 | |
285 | @@ -41,6 +41,8 @@ | |
286 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
287 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
288 | ||
289 | +extern char *http_charset; | |
290 | + | |
291 | extern char *statuswrl_include; | |
292 | ||
293 | extern host *host_list; | |
294 | @@ -202,7 +204,7 @@ | |
295 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
296 | printf("Expires: %s\r\n",date_time); | |
297 | ||
298 | - printf("Content-Type: x-world/x-vrml\r\n\r\n"); | |
299 | + printf("Content-Type: x-world/x-vrml; charset=\"%s\"\r\n\r\n", http_charset); | |
300 | ||
301 | return; | |
302 | } | |
303 | --- nagios-3.0.3/cgi/summary.c 2008-01-24 04:51:30.000000000 +0200 | |
304 | +++ nagios-3.0.3-cgi/cgi/summary.c 2008-10-11 12:34:44.504659246 +0300 | |
305 | @@ -37,6 +37,8 @@ | |
306 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
307 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
308 | ||
309 | +extern char *http_charset; | |
310 | + | |
311 | extern host *host_list; | |
312 | extern hostgroup *hostgroup_list; | |
313 | extern service *service_list; | |
314 | @@ -698,9 +700,9 @@ | |
315 | printf("Expires: %s\r\n",date_time); | |
316 | ||
317 | if(output_format==HTML_OUTPUT) | |
318 | - printf("Content-type: text/html\r\n\r\n"); | |
319 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
320 | else{ | |
321 | - printf("Content-type: text/plain\r\n\r\n"); | |
322 | + printf("Content-type: text/plain; charset=\"%s\"\r\n\r\n", http_charset); | |
323 | return; | |
324 | } | |
325 | ||
326 | --- nagios-3.0.3/cgi/tac.c 2008-02-21 08:17:37.000000000 +0200 | |
327 | +++ nagios-3.0.3-cgi/cgi/tac.c 2008-10-11 12:34:44.508659477 +0300 | |
328 | @@ -52,6 +52,8 @@ | |
329 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
330 | extern char url_media_path[MAX_FILENAME_LENGTH]; | |
331 | ||
332 | +extern char *http_charset; | |
333 | + | |
334 | extern int refresh_rate; | |
335 | ||
336 | extern char *service_critical_sound; | |
337 | @@ -381,7 +383,7 @@ | |
338 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
339 | printf("Expires: %s\r\n",date_time); | |
340 | ||
341 | - printf("Content-type: text/html\r\n\r\n"); | |
342 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
343 | ||
344 | if(embedded==TRUE) | |
345 | return; | |
346 | --- nagios-3.0.3/cgi/trends.c 2008-06-23 23:47:46.000000000 +0300 | |
347 | +++ nagios-3.0.3-cgi/cgi/trends.c 2008-10-11 12:34:44.512659708 +0300 | |
348 | @@ -44,6 +44,8 @@ | |
349 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
350 | extern char physical_images_path[MAX_FILENAME_LENGTH]; | |
351 | ||
352 | +extern char *http_charset; | |
353 | + | |
354 | extern int log_rotation_method; | |
355 | ||
356 | extern host *host_list; | |
357 | @@ -1114,7 +1116,7 @@ | |
358 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
359 | printf("Expires: %s\r\n",date_time); | |
360 | ||
361 | - printf("Content-type: text/html\r\n\r\n"); | |
362 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
363 | ||
364 | if(embedded==TRUE) | |
365 | return; | |
f6f70ac5 ER |
366 | --- nagios-3.0.3/include/cgiutils.h.in 2007-11-11 01:34:26.000000000 +0200 |
367 | +++ nagios-3.0.3-cgi/include/cgiutils.h.in 2008-10-11 12:34:44.468657170 +0300 | |
368 | @@ -422,6 +422,9 @@ | |
369 | #define LIFO_ERROR_FILE 2 | |
370 | #define LIFO_ERROR_DATA 3 | |
371 | ||
372 | +/************************** HTTP CHARSET ****************************/ | |
373 | + | |
374 | +#define DEFAULT_HTTP_CHARSET "iso8859-1" | |
375 | ||
376 | ||
377 | ||
378 | --- nagios-3.0.3/sample-config/cgi.cfg.in 2007-10-07 22:42:52.000000000 +0300 | |
379 | +++ nagios-3.0.3-cgi/sample-config/cgi.cfg.in 2008-10-11 12:34:44.472657400 +0300 | |
380 | @@ -36,6 +36,11 @@ | |
381 | url_html_path=@htmurl@ | |
382 | ||
383 | ||
384 | +# HTTP CHARSET | |
385 | +# This defines charset that is sent with HTTP headers. | |
386 | + | |
387 | +http_charset=iso8859-1 | |
388 | + | |
389 | ||
390 | # CONTEXT-SENSITIVE HELP | |
391 | # This option determines whether or not a context-sensitive |