goto out_return;
}
- expr->kw = aclkw;
+ expr->kw = aclkw->kw;
LIST_INIT(&expr->patterns);
expr->pattern_tree = EB_ROOT_UNIQUE;
expr->parse = aclkw->parse;
arg++;
end = strchr(arg, ')');
if (!end) {
- memprintf(err, "missing closing ')' after arguments to ACL keyword '%s'", expr->kw->kw);
+ memprintf(err, "missing closing ')' after arguments to ACL keyword '%s'", expr->kw);
goto out_free_expr;
}
err, NULL, NULL);
if (nbargs < 0) {
/* note that make_arg_list will have set <err> here */
- memprintf(err, "in argument to '%s', %s", expr->kw->kw, *err);
+ memprintf(err, "in argument to '%s', %s", expr->kw, *err);
goto out_free_expr;
}
/* invalid keyword argument, error must have been
* set by val_args().
*/
- memprintf(err, "in argument to '%s', %s", expr->kw->kw, *err);
+ memprintf(err, "in argument to '%s', %s", expr->kw, *err);
goto out_free_expr;
}
}
* the current one later.
*/
if (type != ARGT_FE && type != ARGT_BE && type != ARGT_TAB) {
- memprintf(err, "ACL keyword '%s' expects %d arguments", expr->kw->kw, ARGM(expr->smp->arg_mask));
+ memprintf(err, "ACL keyword '%s' expects %d arguments", expr->kw, ARGM(expr->smp->arg_mask));
goto out_free_expr;
}
}
else if (ARGM(expr->smp->arg_mask)) {
/* there were some mandatory arguments */
- memprintf(err, "ACL keyword '%s' expects %d arguments", expr->kw->kw, ARGM(expr->smp->arg_mask));
+ memprintf(err, "ACL keyword '%s' expects %d arguments", expr->kw, ARGM(expr->smp->arg_mask));
goto out_free_expr;
}
}
else {
if (arg) {
/* no argument expected */
- memprintf(err, "ACL keyword '%s' takes no argument", expr->kw->kw);
+ memprintf(err, "ACL keyword '%s' takes no argument", expr->kw);
goto out_free_expr;
}
}
expr->match = acl_match_fcts[idx];
}
else {
- memprintf(err, "matching method '%s' cannot be used with fetch keyword '%s'", args[1], expr->kw->kw);
+ memprintf(err, "matching method '%s' cannot be used with fetch keyword '%s'", args[1], expr->kw);
goto out_free_expr;
}
args++;
* null), or false if not conflict is found. The first useless keyword is
* returned.
*/
-int acl_cond_kw_conflicts(const struct acl_cond *cond, unsigned int where, struct acl const **acl, struct acl_keyword const **kw)
+int acl_cond_kw_conflicts(const struct acl_cond *cond, unsigned int where, struct acl const **acl, char const **kw)
{
struct acl_term_suite *suite;
struct acl_term *term;
if (!arg->data.str.len) {
Alert("proxy %s: acl '%s' %s(): missing server name.\n",
- p->id, acl->name, expr->kw->kw);
+ p->id, acl->name, expr->kw);
cfgerr++;
continue;
}
px = findproxy(pname, PR_CAP_BE);
if (!px) {
Alert("proxy %s: acl '%s' %s(): unable to find proxy '%s'.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
srv = findserver(px, sname);
if (!srv) {
Alert("proxy %s: acl '%s' %s(): unable to find server '%s'.\n",
- p->id, acl->name, expr->kw->kw, sname);
+ p->id, acl->name, expr->kw, sname);
cfgerr++;
continue;
}
if (!prx) {
Alert("proxy %s: acl '%s' %s(): unable to find frontend '%s'.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
if (!(prx->cap & PR_CAP_FE)) {
Alert("proxy %s: acl '%s' %s(): proxy '%s' has no frontend capability.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
if (!prx) {
Alert("proxy %s: acl '%s' %s(): unable to find backend '%s'.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
if (!(prx->cap & PR_CAP_BE)) {
Alert("proxy %s: acl '%s' %s(): proxy '%s' has no backend capability.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
if (!prx) {
Alert("proxy %s: acl '%s' %s(): unable to find table '%s'.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
if (!prx->table.size) {
Alert("proxy %s: acl '%s' %s(): no table in proxy '%s'.\n",
- p->id, acl->name, expr->kw->kw, pname);
+ p->id, acl->name, expr->kw, pname);
cfgerr++;
continue;
}
else if (arg->type == ARGT_USR) {
if (!arg->data.str.len) {
Alert("proxy %s: acl '%s' %s(): missing userlist name.\n",
- p->id, acl->name, expr->kw->kw);
+ p->id, acl->name, expr->kw);
cfgerr++;
continue;
}
if (!ul) {
Alert("proxy %s: acl '%s' %s(%s): unable to find userlist.\n",
- p->id, acl->name, expr->kw->kw, arg->data.str.str);
+ p->id, acl->name, expr->kw, arg->data.str.str);
cfgerr++;
continue;
}
if (cfgerr)
break;
- if (!strcmp(expr->kw->kw, "http_auth_group")) {
+ if (!strcmp(expr->kw, "http_auth_group")) {
/* note: argument resolved above thanks to ARGT_USR */
if (LIST_ISEMPTY(&expr->patterns)) {
Alert("proxy %s: acl %s %s(): no groups specified.\n",
- p->id, acl->name, expr->kw->kw);
+ p->id, acl->name, expr->kw);
cfgerr++;
continue;
}
if (!pattern->val.group_mask) {
Alert("proxy %s: acl %s %s(): invalid group(s).\n",
- p->id, acl->name, expr->kw->kw);
+ p->id, acl->name, expr->kw);
cfgerr++;
continue;
}
static int warnif_cond_conflicts(const struct acl_cond *cond, unsigned int where, const char *file, int line)
{
const struct acl *acl;
- const struct acl_keyword *kw;
+ const char *kw;
if (!cond)
return 0;
file, line, acl->name, sample_ckp_names(where));
else
Warning("parsing [%s:%d] : anonymous acl will never match because it uses keyword '%s' which is incompatible with '%s'\n",
- file, line, LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw->kw, sample_ckp_names(where));
+ file, line, LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw, sample_ckp_names(where));
return ERR_WARN;
}
if (!acl_cond_kw_conflicts(cond, where, &acl, &kw))
if (acl->name && *acl->name)
Warning("parsing [%s:%d] : acl '%s' involves keywords '%s' which is incompatible with '%s'\n",
- file, line, acl->name, kw->kw, sample_ckp_names(where));
+ file, line, acl->name, kw, sample_ckp_names(where));
else
Warning("parsing [%s:%d] : anonymous acl involves keyword '%s' which is incompatible with '%s'\n",
- file, line, kw->kw, sample_ckp_names(where));
+ file, line, kw, sample_ckp_names(where));
return ERR_WARN;
}
struct tcp_rule *rule;
unsigned int where;
const struct acl *acl;
- const struct acl_keyword *kw;
+ const char *kw;
if (!*args[1]) {
memprintf(err, "missing argument for '%s' in %s '%s'",
memprintf(err,
"anonymous acl will never match in '%s %s' because it uses keyword '%s' which is incompatible with '%s'",
args[0], args[1],
- LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw->kw,
+ LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw,
sample_ckp_names(where));
warn++;
if (acl->name && *acl->name)
memprintf(err,
"acl '%s' involves keyword '%s' which is incompatible with '%s'",
- acl->name, kw->kw, sample_ckp_names(where));
+ acl->name, kw, sample_ckp_names(where));
else
memprintf(err,
"anonymous acl involves keyword '%s' which is incompatible with '%s'",
- kw->kw, sample_ckp_names(where));
+ kw, sample_ckp_names(where));
warn++;
}
struct tcp_rule *rule;
unsigned int where;
const struct acl *acl;
- const struct acl_keyword *kw;
+ const char *kw;
if (!*args[1]) {
if (curpx == defpx)
memprintf(err,
"anonymous acl will never match in '%s %s' because it uses keyword '%s' which is incompatible with '%s'",
args[0], args[1],
- LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw->kw,
+ LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw,
sample_ckp_names(where));
warn++;
if (acl->name && *acl->name)
memprintf(err,
"acl '%s' involves keyword '%s' which is incompatible with '%s'",
- acl->name, kw->kw, sample_ckp_names(where));
+ acl->name, kw, sample_ckp_names(where));
else
memprintf(err,
"anonymous acl involves keyword '%s' which is incompatible with '%s'",
- kw->kw, sample_ckp_names(where));
+ kw, sample_ckp_names(where));
warn++;
}
memprintf(err,
"anonymous acl will never match in '%s %s' because it uses keyword '%s' which is incompatible with '%s'",
args[0], args[1],
- LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw->kw,
+ LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw,
sample_ckp_names(where));
warn++;
if (acl->name && *acl->name)
memprintf(err,
"acl '%s' involves keyword '%s' which is incompatible with '%s'",
- acl->name, kw->kw, sample_ckp_names(where));
+ acl->name, kw, sample_ckp_names(where));
else
memprintf(err,
"anonymous acl involves keyword '%s' which is incompatible with '%s'",
- kw->kw, sample_ckp_names(where));
+ kw, sample_ckp_names(where));
warn++;
}