From cedc65ad5d92e8588f697a4ab0dc1914c308b4dd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 14 Dec 2013 22:27:19 +0100 Subject: [PATCH] mod_auth.cpp: fix no_auth_client handling change find() to compare() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7f72fa6f3d97955f977825c533ffc8b90e5a19ab Author: vanhofen Date: 2013-12-14 (Sat, 14 Dec 2013) Origin message was: ------------------ - mod_auth.cpp: fix no_auth_client handling change find() to compare() --- src/nhttpd/yhttpd_mods/mod_auth.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 89dc65f1b..c11a0f046 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -14,10 +14,10 @@ THandleStatus CmAuth::Hook_PrepareResponse(CyhookHandler *hh) { THandleStatus status = HANDLED_CONTINUE; + // dont check local calls or calls from NoAuthClient if (authenticate) { if ((hh->UrlData["clientaddr"]).find(IADDR_LOCAL) > 0 - && (no_auth_client == "" || (hh->UrlData["clientaddr"]).find( - no_auth_client) > 0)) // dont check local calls or calls from NoAuthClient + && (no_auth_client == "" || (hh->UrlData["clientaddr"]).compare(no_auth_client) != 0)) { if (!CheckAuth(hh)) { hh->SetError(HTTP_UNAUTHORIZED);