mod_auth.cpp: fix no_auth_client handling

change find() to compare()


Origin commit data
------------------
Commit: 7f72fa6f3d
Author: vanhofen <vanhofen@gmx.de>
Date: 2013-12-14 (Sat, 14 Dec 2013)

Origin message was:
------------------
- mod_auth.cpp: fix no_auth_client handling

 change find() to compare()
This commit is contained in:
vanhofen
2013-12-14 22:27:19 +01:00
parent 19ee08c6c0
commit cedc65ad5d

View File

@@ -14,10 +14,10 @@
THandleStatus CmAuth::Hook_PrepareResponse(CyhookHandler *hh) { THandleStatus CmAuth::Hook_PrepareResponse(CyhookHandler *hh) {
THandleStatus status = HANDLED_CONTINUE; THandleStatus status = HANDLED_CONTINUE;
// dont check local calls or calls from NoAuthClient
if (authenticate) { if (authenticate) {
if ((hh->UrlData["clientaddr"]).find(IADDR_LOCAL) > 0 if ((hh->UrlData["clientaddr"]).find(IADDR_LOCAL) > 0
&& (no_auth_client == "" || (hh->UrlData["clientaddr"]).find( && (no_auth_client == "" || (hh->UrlData["clientaddr"]).compare(no_auth_client) != 0))
no_auth_client) > 0)) // dont check local calls or calls from NoAuthClient
{ {
if (!CheckAuth(hh)) { if (!CheckAuth(hh)) {
hh->SetError(HTTP_UNAUTHORIZED); hh->SetError(HTTP_UNAUTHORIZED);