51 debugs(28, 3,
this <<
" answer " <<
answer_ <<
" for " << reason);
58 debugs(28, 3,
this <<
" checking " << what);
72 const auto &child = *pos;
83 result = child->matches(
this);
111 debugs(28, 2,
this <<
" a fast-only directive uses a slow ACL!");
117 debugs(28, 2,
this <<
" a slow ACL resumes by going async again! (loop #" <<
asyncLoopDepth_ <<
")");
129 starter(*
Filled(
this), acl);
168 accessList (nullptr),
170 callback_data (nullptr),
175 asyncStage_(asyncNone),
183 debugs(28, 4,
"ACLChecklist::~ACLChecklist: destroyed " <<
this);
189 accessList = replacement ? *replacement :
nullptr;
217 debugs(28,
DBG_CRITICAL,
"SECURITY ERROR: ACL " <<
this <<
" checked with nothing to match against!!");
280 const auto savedList =
swapAcl(list);
337 implicitRuleAnswer.implicit =
true;
338 debugs(28, 3,
this <<
" NO match found, last action " <<
339 lastAction <<
" so returning " << implicitRuleAnswer);
353 debugs(28, 5,
"Action '" << action <<
"/" << action.
kind << (found ?
"' is " :
"' is not") <<
" banned");
#define Assure(condition)
void ACLCB(Acl::Answer, void *)
ACL checklist callback.
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
int cbdataReferenceValid(const void *p)
#define cbdataReference(var)
#define cbdataReferenceValidDone(var, ptr)
Position of a child node within an Acl::Node tree.
RefCount< const Acl::InnerNode > parent
intermediate node in the ACL tree
Acl::Nodes::const_iterator position
child position inside parent
void markFinished(const Acl::Answer &newAnswer, const char *reason)
void completeNonBlocking()
void banAction(const Acl::Answer &action)
add action to the list of banned actions
std::vector< Acl::Answer > bannedActions_
the list of actions which must ignored during acl checks
Breadcrumb matchLoc_
location of the node running matches() now
void resumeNonBlockingCheck()
void preCheck(const char *what)
prepare for checking ACLs; called once per check
Acl::Answer const & fastCheck()
bool asyncCaller_
whether the caller supports async/slow ACLs
void(ACLFilledChecklist &, const Acl::Node &) AsyncStarter
a function that initiates asynchronous ACL checks; see goAsync()
void nonBlockingCheck(ACLCB *callback, void *callback_data)
bool finished() const
whether markFinished() was called
bool occupied_
whether a check (fast or non-blocking) is in progress
bool goAsync(AsyncStarter, const Acl::Node &)
void changeAcl(const acl_access *)
change the current ACL list
Acl::TreePointer swapAcl(const acl_access *)
change the current ACL list
bool matchChild(const Acl::InnerNode *parent, Acl::Nodes::const_iterator pos)
std::stack< Breadcrumb > matchPath
suspended (due to an async lookup) matches() in the ACL tree
bool prepNonBlocking()
common parts of nonBlockingCheck() and resumeNonBlockingCheck()
bool bannedAction(const Acl::Answer &action) const
whether the action is banned or not
Acl::TreePointer accessList
void matchAndFinish()
performs (or resumes) an ACL tree match and, if successful, sets the action
unsigned asyncLoopDepth_
how many times the current async state has resumed
bool asyncInProgress() const
async call has been started and has not finished (or failed) yet
Breadcrumb asyncLoc_
currentNode_ that called goAsync()
void calcImplicitAnswer()
void checkCallback(const char *abortReason)
const Acl::Answer & currentAnswer() const
std::optional< SBuf > lastCheckedName_
the name of the last evaluated ACL (if any ACLs were evaluated)
int kind
the matched custom access list verb (or zero)
std::optional< SBuf > lastCheckedName
the name of the ACL (if any) that was evaluated last while obtaining this answer
An intermediate Acl::Node tree node. Manages a collection of child tree nodes.
bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const
Resumes matching (suspended by an async call) at the given position.
bool matches(ACLChecklist *checklist) const
Answer winningAction() const
Returns the corresponding action after a successful tree match.
Answer lastAction() const
what action to use if no nodes matched
#define debugs(SECTION, LEVEL, CONTENT)