From: wessels <> Date: Tue, 25 Feb 1997 03:21:37 +0000 (+0000) Subject: support src ACLs in cache_host_acl X-Git-Tag: SQUID_3_0_PRE1~5080 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ae8bb059a71c7e806d4fa6ec89a3fe0011cb93f;p=thirdparty%2Fsquid.git support src ACLs in cache_host_acl --- diff --git a/src/client_side.cc b/src/client_side.cc index cdef7ba27b..9278bab7fd 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.89 1997/02/13 18:38:28 wessels Exp $ + * $Id: client_side.cc,v 1.90 1997/02/24 20:21:37 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -159,6 +159,8 @@ clientAccessCheck(icpStateData * icpState, void (*handler) (icpStateData *, int) icpState->ident.ident, ICP_IDENT_SZ); } + /* This so we can have SRC ACLs for cache_host_acl. */ + icpState->request->client_addr = icpState->peer.sin_addr; #if USE_PROXY_AUTH if (clientProxyAuthCheck(icpState) == 0) { char *wbuf = NULL; diff --git a/src/neighbors.cc b/src/neighbors.cc index c293ec1e80..e49a96b5cf 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $Id: neighbors.cc,v 1.117 1997/02/23 09:05:20 wessels Exp $ + * $Id: neighbors.cc,v 1.118 1997/02/24 20:21:38 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -233,7 +233,7 @@ peerAllowedToUse(const peer * e, request_t * request) return d->do_ping; do_ping = !d->do_ping; } - checklist.src_addr = any_addr; /* XXX bogus! */ + checklist.src_addr = request->client_addr; checklist.request = request; for (a = e->acls; a; a = a->next) { if (aclMatchAcl(a->acl, &checklist)) @@ -919,13 +919,15 @@ neighborAddAcl(const char *host, const char *aclname) xfree(L); return; } +#ifdef NOW_SUPPORTED if (a->type == ACL_SRC_IP) { debug(15, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(15, 0, "neighborAddAcl: 'src' ALC's not supported for 'cache_host_acl'\n"); + debug(15, 0, "neighborAddAcl: 'src' ACL's not supported for 'cache_host_acl'\n"); xfree(L); return; } +#endif L->acl = a; for (Tail = &(e->acls); *Tail; Tail = &((*Tail)->next)); *Tail = L;