37 debugs(28, 3,
"ERR_NONE because access was denied without evaluating ACLs");
44 if (!redirect_allowed && strchr(A->err_page_name,
':') ) {
45 debugs(28, 8,
"Skip '" << A->err_page_name <<
"' 30x redirects not allowed as response here.");
49 for (
const auto &aclName: A->acl_list) {
50 if (aclName.cmp(name) == 0) {
51 debugs(28, 8,
"matched " << name <<
"; returning " << A->err_page_id <<
' ' << A->err_page_name);
52 return A->err_page_id;
65 debugs(28, 3,
"no; caller did not supply an ACL name");
70 debugs(28, 5,
"returning " << a->isProxyAuth() <<
" for ACL " << *name);
71 return a->isProxyAuth();
74 debugs(28, 3,
"WARNING: Called for nonexistent ACL " << *name);
98 debugs(28,
DBG_CRITICAL,
"ERROR: aclParseDenyInfoLine: missing 'error page' parameter.");
106 A->acl_list.emplace_back(t);
109 if (A->acl_list.empty()) {
111 debugs(28,
DBG_CRITICAL,
"aclParseDenyInfoLine: deny_info line contains no ACL's, skipping");
126 const auto &treePtr = *config;
144 if (!strcmp(t,
"allow"))
146 else if (!strcmp(t,
"deny"))
150 debugs(28,
DBG_CRITICAL,
"aclParseAccessLine: expecting 'allow' or 'deny', got '" << t <<
"'.");
154 const int ruleId = ((config && *config) ? ToTree(*config).
childrenCount() : 0) + 1;
161 debugs(28,
DBG_CRITICAL,
"aclParseAccessLine: Access line contains no ACL's, skipping");
171 const auto treep = *config;
179 (*treep)->add(rule, action);
216 debugs(28, 8,
"aclDestroyAclList: invoked");
227 debugs(28, 3,
"destroying: " << *list <<
' ' << ToTree(*list).
name);
241 debugs(28, 8,
"aclDestroyDenyInfoList: invoked");
243 for (a = *list; a; a = a_next) {
#define Assure(condition)
err_type FindDenyInfoPage(const Acl::Answer &answer, const bool redirect_allowed)
bool aclIsProxyAuth(const std::optional< SBuf > &name)
void aclParseAccessLine(const char *directive, ConfigParser &, acl_access **config)
Parses a single line of a "action followed by acls" directive (e.g., http_access).
size_t aclParseAclList(ConfigParser &, ACLList **config, const char *label)
Acl::TreePointer acl_access
squidaio_request_t * head
const char * cfg_directive
During parsing, the name of the current squid.conf directive being parsed.
char config_input_line[BUFSIZ]
const char * cfg_filename
deny_info representation. Currently a POD.
std::optional< SBuf > lastCheckedName
the name of the ACL (if any) that was evaluated last while obtaining this answer
Nodes::size_type childrenCount() const
the number of children nodes
bool empty() const override
void context(const SBuf &aName, const char *configuration)
sets user-specified ACL name and squid.conf context
static Acl::Node * FindByName(const SBuf &)
A configured ACL with a given name or nil.
void add(Acl::Node *rule, const Answer &action)
appends and takes control over the rule with a given action
static SBuf CurrentLocation()
static char * NextToken()
AclDenyInfoList * denyInfoList
#define debugs(SECTION, LEVEL, CONTENT)
void aclDestroyAccessList(acl_access **list)
void aclDestroyDenyInfoList(AclDenyInfoList **list)
void aclDestroyAclList(ACLList **list)
void aclParseDenyInfoLine(AclDenyInfoList **head)
const Tree & ToTree(const TreePointer *cfg)
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf