From: hno <> Date: Fri, 15 Oct 2004 05:32:45 +0000 (+0000) Subject: Bug #833: deny_info only works with http_access, not http_reply_access or miss_access X-Git-Tag: SQUID_3_0_PRE4~1022 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0185bd6f66eabf7d22aa81109371825a0754956a;p=thirdparty%2Fsquid.git Bug #833: deny_info only works with http_access, not http_reply_access or miss_access --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index d8127063a2..5c9fe54fcb 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.72 2004/09/26 16:38:01 hno Exp $ + * $Id: client_side_reply.cc,v 1.73 2004/10/14 23:32:45 hno Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1868,14 +1868,25 @@ clientReplyContext::processReplyAccessResult(bool accessAllowed) * to tell if this is a squid generated error page, or one from * upstream at this point. */ ErrorState *err; + err_type page_id; + page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName); + + if (page_id == ERR_NONE) + page_id = ERR_ACCESS_DENIED; + err = - clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL, + clientBuildError(page_id, HTTP_FORBIDDEN, NULL, http->getConn().getRaw() != NULL ? &http->getConn()->peer.sin_addr : &no_addr, http->request); + removeClientStoreReference(&sc, http); + startError(err); + httpReplyDestroy(rep); + http->logType = LOG_TCP_DENIED_REPLY; + return; } diff --git a/src/forward.cc b/src/forward.cc index 0c50f9269d..9a6d635a86 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.120 2004/10/10 02:49:05 hno Exp $ + * $Id: forward.cc,v 1.121 2004/10/14 23:32:45 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -884,10 +884,20 @@ fwdStart(int fd, StoreEntry * e, HttpRequest * r) ch.accessList = NULL; if (answer == 0) { - err = errorCon(ERR_FORWARDING_DENIED, HTTP_FORBIDDEN); + err_type page_id; + page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName); + + if (page_id == ERR_NONE) + page_id = ERR_FORWARDING_DENIED; + + err = errorCon(page_id, HTTP_FORBIDDEN); + err->request = requestLink(r); + err->src_addr = r->client_addr; + errorAppendEntry(e, err); + return; } }