Thread: [Nagios-checkins] SF.net SVN: nagios:[1819] nagioscore/trunk/cgi/cgiutils.c
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: <ag...@us...> - 2011-10-07 13:48:32
|
Revision: 1819 http://nagios.svn.sourceforge.net/nagios/?rev=1819&view=rev Author: ageric Date: 2011-10-07 13:48:21 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Fix url_encode()'s handling of spaces and (some) special chars Only spaces are supposed to be replaced with a +. All other chars should be represented as hex values. This is supposed to fix issue #198, though I can't test that. It makes sense though, since some utf8 marker chars would previously have gotten replaced with pluses instead of their actual code valus. Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2011-10-07 12:35:21 UTC (rev 1818) +++ nagioscore/trunk/cgi/cgiutils.c 2011-10-07 13:48:21 UTC (rev 1819) @@ -924,7 +924,7 @@ } /* spaces are pluses */ - else if((char)input[x] <= (char)' ') { + else if(input[x] == ' ') { str[y] = '+'; y++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-10-07 14:29:48
|
Revision: 1821 http://nagios.svn.sourceforge.net/nagios/?rev=1821&view=rev Author: ageric Date: 2011-10-07 14:29:38 +0000 (Fri, 07 Oct 2011) Log Message: ----------- cgis: Don't lowercase SSI headers and footers Doing so means anyone using ssi files in upper case will get errors in their apache log. Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2011-10-07 14:29:21 UTC (rev 1820) +++ nagioscore/trunk/cgi/cgiutils.c 2011-10-07 14:29:38 UTC (rev 1821) @@ -1498,8 +1498,6 @@ stripped_cgi_name = strtok(raw_cgi_name, "."); snprintf(cgi_ssi_file, sizeof(cgi_ssi_file) - 1, "%s%s-%s.ssi", physical_ssi_path, (stripped_cgi_name == NULL) ? "" : stripped_cgi_name, (type == SSI_HEADER) ? "header" : "footer"); cgi_ssi_file[sizeof(cgi_ssi_file) - 1] = '\x0'; - for(x = 0; x < strlen(cgi_ssi_file); x++) - cgi_ssi_file[x] = tolower(cgi_ssi_file[x]); if(type == SSI_HEADER) { printf("\n<!-- Produced by Nagios (http://www.nagios.org). Copyright (c) 1999-2007 Ethan Galstad. -->\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2012-09-10 16:23:12
|
Revision: 2165 http://nagios.svn.sourceforge.net/nagios/?rev=2165&view=rev Author: ageric Date: 2012-09-10 16:23:06 +0000 (Mon, 10 Sep 2012) Log Message: ----------- cgis: Fix a few compile errors There are legions more, I'm sure. I really need to try to give them some attention from time to time. Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2012-09-10 16:22:48 UTC (rev 2164) +++ nagioscore/trunk/cgi/cgiutils.c 2012-09-10 16:23:06 UTC (rev 2165) @@ -27,6 +27,8 @@ #include "../include/cgiutils.h" +char *object_precache_file = NULL, *object_cache_file = NULL; + char main_config_file[MAX_FILENAME_LENGTH]; char log_file[MAX_FILENAME_LENGTH]; char log_archive_path[MAX_FILENAME_LENGTH]; @@ -545,7 +547,7 @@ int result = OK; /* read in all external config data of the desired type(s) */ - result = read_object_config_data(config_file, options, FALSE, FALSE); + result = read_object_config_data(config_file, options); return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2012-10-23 01:20:37
|
Revision: 2392 http://nagios.svn.sourceforge.net/nagios/?rev=2392&view=rev Author: ageric Date: 2012-10-23 01:20:31 +0000 (Tue, 23 Oct 2012) Log Message: ----------- cgi/cgiutils: Silence a compiler warning Why a char can't be a an array subscript I have no idea, but casting it to an int at least makes gcc shut up. Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2012-10-23 01:20:13 UTC (rev 2391) +++ nagioscore/trunk/cgi/cgiutils.c 2012-10-23 01:20:31 UTC (rev 2392) @@ -412,7 +412,7 @@ } for(p = illegal_output_chars; p && *p; p++) - illegal_output_char_map[*p] = 1; + illegal_output_char_map[(int)*p] = 1; /* free memory and close the file */ free(input); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2013-01-09 12:14:10
|
Revision: 2560 http://nagios.svn.sourceforge.net/nagios/?rev=2560&view=rev Author: ageric Date: 2013-01-09 12:14:03 +0000 (Wed, 09 Jan 2013) Log Message: ----------- cgis: Use nagios.cfg-relative path when reading objects.cache Patched-by: Ton Voon <to...@gm...> Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2013-01-08 17:13:17 UTC (rev 2559) +++ nagioscore/trunk/cgi/cgiutils.c 2013-01-09 12:14:03 UTC (rev 2560) @@ -461,6 +461,12 @@ strip(log_file); } + else if(strstr(input, "object_cache_file=") == input) { + temp_buffer = strtok(input, "="); + temp_buffer = strtok(NULL, "\x0"); + object_cache_file = nspath_absolute(temp_buffer, config_file_dir); + } + else if(strstr(input, "log_archive_path=") == input) { temp_buffer = strtok(input, "="); temp_buffer = strtok(NULL, "\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <est...@us...> - 2013-02-16 17:49:22
|
Revision: 2608 http://nagios.svn.sourceforge.net/nagios/?rev=2608&view=rev Author: estanley375 Date: 2013-02-16 17:49:16 +0000 (Sat, 16 Feb 2013) Log Message: ----------- Forward patch of fix for bug #369 Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2013-02-16 17:41:54 UTC (rev 2607) +++ nagioscore/trunk/cgi/cgiutils.c 2013-02-16 17:49:16 UTC (rev 2608) @@ -913,7 +913,7 @@ else { str[y] = '\x0'; if((int)strlen(str) < (output_len - 3)) { - sprintf(temp_expansion, "%%%02X", (unsigned int)input[x]); + sprintf(temp_expansion, "%%%02X", (unsigned char)input[x]); strcat(str, temp_expansion); y += 3; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2013-04-07 15:46:59
|
Revision: 2738 http://nagios.svn.sourceforge.net/nagios/?rev=2738&view=rev Author: ageric Date: 2013-04-07 15:46:51 +0000 (Sun, 07 Apr 2013) Log Message: ----------- cgi: Fix check of return value for mbstowcs() On errors, it returns (size_t)-1, which isn't the same as <nocast> < 0. The distinction is fairly important, since not casting size_t and evaluating a return value against < 0 means we'll never match, so we could print garbage to the screen when we fail to convert some characters. Signed-off-by: Andreas Ericsson <ae...@op...> Modified Paths: -------------- nagioscore/trunk/cgi/cgiutils.c Modified: nagioscore/trunk/cgi/cgiutils.c =================================================================== --- nagioscore/trunk/cgi/cgiutils.c 2013-04-07 15:46:32 UTC (rev 2737) +++ nagioscore/trunk/cgi/cgiutils.c 2013-04-07 15:46:51 UTC (rev 2738) @@ -952,7 +952,7 @@ if(( wcinput = malloc( len * sizeof( wchar_t))) == NULL) { return ""; } - if(( mbstowcs_result = mbstowcs( wcinput, input, len)) < 0) { + if((mbstowcs_result = mbstowcs( wcinput, input, len)) == (size_t)-1) { free( wcinput); return ""; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |