/*
- * $Id: ACL.h,v 1.17 2006/08/21 00:50:40 robertc Exp $
+ * $Id: ACL.h,v 1.18 2007/01/28 15:37:46 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
SQUIDCEXTERN void aclParseAccessLine(ConfigParser &parser, acl_access **);
SQUIDCEXTERN void aclParseAclList(ConfigParser &parser, acl_list **);
SQUIDCEXTERN int aclIsProxyAuth(const char *name);
-SQUIDCEXTERN err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
+SQUIDCEXTERN err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed);
SQUIDCEXTERN void aclParseDenyInfoLine(struct _acl_deny_info_list **);
/*
- * $Id: acl_noncore.cc,v 1.3 2006/08/21 00:50:41 robertc Exp $
+ * $Id: acl_noncore.cc,v 1.4 2007/01/28 15:37:46 serassio Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
/* does name lookup, returns page_id */
err_type
-aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name)
+aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed)
{
acl_deny_info_list *A = NULL;
- acl_name_list *L = NULL;
debug(28,9)("aclGetDenyInfoPage: got called for %s\n",name);
- A = *head;
-
- if (NULL == *head) { /* empty list */
- debug(28,9)("aclGetDenyInfoPage: called for an empty list\n");
- return ERR_NONE;
- }
- while (A) {
- L = A->acl_list;
+ for (A = *head; A; A = A->next) {
+ acl_name_list *L = NULL;
- if (NULL == L) { /* empty list should never happen, but in case */
+ if (!redirect_allowed && strchr(A->err_page_name, ':')) {
debug(28,3)("aclGetDenyInfoPage: "
"WARNING, unexpected codepath taken\n");
continue;
}
- while (L) {
+ for (L = A->acl_list; L; L = L->next) {
if (!strcmp(name, L->name)) {
debug(28,8)("aclGetDenyInfoPage: match on %s\n",name);
return A->err_page_id;
}
- L = L->next;
}
-
- A = A->next;
}
debug(28,8)("aclGetDenyInfoPage: no match\n");
/*
- * $Id: client_side_reply.cc,v 1.114 2006/10/02 11:35:39 adrian Exp $
+ * $Id: client_side_reply.cc,v 1.115 2007/01/28 15:37:46 serassio Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
* upstream at this point. */
ErrorState *err;
err_type page_id;
- page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName);
+ page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName, 1);
if (page_id == ERR_NONE)
page_id = ERR_ACCESS_DENIED;
/*
- * $Id: client_side_request.cc,v 1.77 2006/10/31 23:30:57 wessels Exp $
+ * $Id: client_side_request.cc,v 1.78 2007/01/28 15:37:46 serassio Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
* - storeReleaseRequest was always called if entry was valid
*/
assert(logType < LOG_TYPE_MAX);
+
logRequest();
+
loggingEntry(NULL);
if (request)
freeResources();
#if ICAP_CLIENT
+
if (icap)
delete icap;
+
#endif
+
if (calloutContext)
delete calloutContext;
/* moving to the next connection is handled by the context free */
dlinkDelete(&active, &ClientActiveRequests);
+
PROF_stop(httpRequestFree);
}
if (answer != ACCESS_ALLOWED) {
/* Send an error */
+ int require_auth = (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName));
debug(85, 5) ("Access Denied: %s\n", http->uri);
debug(85, 5) ("AclMatchedName = %s\n",
AclMatchedName ? AclMatchedName : "<null>");
- debug(85, 5) ("Proxy Auth Message = %s\n",
- proxy_auth_msg ? proxy_auth_msg : "<null>");
+
+ if (require_auth)
+ debug(33, 5) ("Proxy Auth Message = %s\n",
+ proxy_auth_msg ? proxy_auth_msg : "<null>");
+
/*
* NOTE: get page_id here, based on AclMatchedName because if
* USE_DELAY_POOLS is enabled, then AclMatchedName gets clobbered in
* the clientCreateStoreEntry() call just below. Pedro Ribeiro
* <pribeiro@isel.pt>
*/
- page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName);
+ page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName, answer != ACCESS_REQ_PROXY_AUTH);
+
http->logType = LOG_TCP_DENIED;
- if (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName)) {
+ if (require_auth) {
if (!http->flags.accel) {
/* Proxy authorisation needed */
status = HTTP_PROXY_AUTHENTICATION_REQUIRED;
* to the user, or keep going without ICAP.
*/
fatal("Fix this case in ClientRequestContext::icapAclCheckDone()");
+
// And when fixed, check whether the service is down in doIcap and
// if it is, abort early, without creating ICAPClientReqmodPrecache.
// See Server::startIcap() and its use.
/*
- * $Id: forward.cc,v 1.151 2006/09/13 15:54:21 adrian Exp $
+ * $Id: forward.cc,v 1.152 2007/01/28 15:37:46 serassio Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
if (answer == 0) {
err_type page_id;
- page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName);
+ page_id = aclGetDenyInfoPage(&Config.denyInfoList, AclMatchedName, 1);
if (page_id == ERR_NONE)
page_id = ERR_FORWARDING_DENIED;