Case insensitive CGI search

Holger Weiss holger at CIS.FU-Berlin.DE
Fri Sep 9 21:36:01 CEST 2005


Just a minor request: IMO it would be nice to make the CGI hostname
search case insensitive, as the attached patch does.

Holger

-- 
PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE
-------------- next part --------------
Index: status.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/status.c,v
retrieving revision 1.39
diff -u -r1.39 status.c
--- status.c	12 Jun 2005 00:17:55 -0000	1.39
+++ status.c	9 Sep 2005 19:11:06 -0000
@@ -251,7 +251,7 @@
 				for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){
 					if(is_authorized_for_host(temp_host,&current_authdata)==FALSE)
 						continue;
-					if(strstr(temp_host->name,host_name)==temp_host->name){
+					if(!strncasecmp(temp_host->name,host_name,strlen(host_name))){
 						free(host_name);
 						host_name=strdup(temp_host->name);
 						break;


More information about the Developers mailing list