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