26 debugs(28, 7,
"user is " << user <<
", case_insensitive is " <<
flags.case_insensitive);
28 if (user ==
nullptr || strcmp(user,
"-") == 0)
32 debugs(28, 7,
"aclMatchUser: user REQUIRED and auth-info present.");
37 debugs(28, 7,
"returning " << result);
47 sl.push_back(
SBuf(
"REQUIRED"));
51 if (
flags.case_insensitive)
52 sl.push_back(
SBuf(
"-i"));
56 debugs(28,5,
"ACLUserData dump output: " <<
65 return (lhs.
cmp(rhs) < 0);
77 flags.case_insensitive =
false;
78 flags.required =
false;
85 static const Acl::Options MyOptions = { &MyCaseSensitivityOption };
93 debugs(28, 2,
"parsing user list");
99 debugs(28, 5,
"first token is " << s);
101 if (s.
cmp(
"-i",2) == 0) {
102 debugs(28, 5,
"Going case-insensitive");
103 flags.case_insensitive =
true;
109 }
else if (s.
cmp(
"REQUIRED") == 0) {
110 debugs(28, 5,
"REQUIRED-type enabled");
111 flags.required =
true;
113 if (
flags.case_insensitive)
116 debugs(28, 6,
"Adding user " << s);
121 debugs(28, 3,
"Case-insensitive-switch is " <<
flags.case_insensitive);
124 debugs(28, 4,
"parsing following tokens");
128 debugs(28, 6,
"Got token: " << s);
130 if (
flags.case_insensitive)
133 debugs(28, 6,
"Adding user " << s);
138 debugs(28,
DBG_PARSE_NOTE(1),
"WARNING: detected attempt to add usernames to an acl of type REQUIRED");
SBuf JoinContainerToSBuf(const ContainerIterator &begin, const ContainerIterator &end, const SBuf &separator, const SBuf &prefix=SBuf(), const SBuf &suffix=SBuf())
convenience wrapper of JoinContainerIntoSBuf with no caller-supplied SBuf
static bool CaseInsensitveSBufCompare(const SBuf &lhs, const SBuf &rhs)
static bool CaseSensitiveSBufCompare(const SBuf &lhs, const SBuf &rhs)
std::set< SBuf, bool(*)(const SBuf &, const SBuf &)> UserDataNames_t
UserDataNames_t userDataNames
bool empty() const override
struct ACLUserData::@16 flags
const Acl::Options & lineOptions() override
supported ACL "line" options (e.g., "-i")
bool match(char const *user) override
SBufList dump() const override
static Acl::BooleanOptionValue CaseInsensitive_
whether parse() is called in a case insensitive context
static char * strtokFile()
int caseCmp(const SBuf &S, const size_type n) const
shorthand version for case-insensitive compare()
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
void toLower()
converts all characters to lower case;
#define DBG_PARSE_NOTE(x)
#define debugs(SECTION, LEVEL, CONTENT)
const BooleanOption & CaseSensitivityOption()
std::vector< const Option * > Options
std::list< SBuf > SBufList