Re: [Nagios-devel] Case insensitive CGI search
Posted: Sat Sep 10, 2005 8:21 am
* Andreas Ericsson [2005-09-10 17:30]:
> Holger Weiss wrote:
> >Just a minor request: IMO it would be nice to make the CGI hostname
> >search case insensitive, as the attached patch does.
>
> But the patch requires an absolute match, whereas the strstr() matching
> doesn't.
Note that "strstr(temp_host->name,host_name)==temp_host->name" is true
only if strstr() returns a pointer to the first char of temp_host->name.
Testing "strncmp(temp_host->name,host_name,strlen(host_name))" against 0
would have done essentially the same thing, and using strncasecmp() just
adds the case insensitivity.
In other words, no matter whether or not you use the patch, if "foobar"
is your only host beginning with "foo", it will be found by searching
"foo", but it won't be found by searching "bar". The patch only adds
that "foobar" will also be found by search "Foo" or "FooBar".
Holger
--
PGP fingerprint: F1F0 9071 8084 A426 DD59 9839 59D3 F3A1 B8B5 D3DE
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> Holger Weiss wrote:
> >Just a minor request: IMO it would be nice to make the CGI hostname
> >search case insensitive, as the attached patch does.
>
> But the patch requires an absolute match, whereas the strstr() matching
> doesn't.
Note that "strstr(temp_host->name,host_name)==temp_host->name" is true
only if strstr() returns a pointer to the first char of temp_host->name.
Testing "strncmp(temp_host->name,host_name,strlen(host_name))" against 0
would have done essentially the same thing, and using strncasecmp() just
adds the case insensitivity.
In other words, no matter whether or not you use the patch, if "foobar"
is your only host beginning with "foo", it will be found by searching
"foo", but it won't be found by searching "bar". The patch only adds
that "foobar" will also be found by search "Foo" or "FooBar".
Holger
--
PGP fingerprint: F1F0 9071 8084 A426 DD59 9839 59D3 F3A1 B8B5 D3DE
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]