From 88922354fb8de63578a4877e0506b0a538170a42 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 4 Oct 2009 22:02:50 +0200 Subject: [PATCH] [MINOR] config: add pointer to file name in block/redirect/use_backend/monitor rules Those conditions already referenced the config line, but not the file. --- include/types/acl.h | 39 ++++++++++++++++++++------------------- src/cfgparse.c | 4 ++++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/include/types/acl.h b/include/types/acl.h index 431e22b44..aff330ea6 100644 --- a/include/types/acl.h +++ b/include/types/acl.h @@ -1,23 +1,23 @@ /* - include/types/acl.h - This file provides structures and types for ACLs. - - Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1 - exclusively. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ + * include/types/acl.h + * This file provides structures and types for ACLs. + * + * Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, version 2.1 + * exclusively. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef _TYPES_ACL_H #define _TYPES_ACL_H @@ -320,6 +320,7 @@ struct acl_cond { struct list suites; /* list of acl_term_suites */ int pol; /* polarity: ACL_COND_IF / ACL_COND_UNLESS */ unsigned int requires; /* or'ed bit mask of all acl's ACL_USE_* */ + const char *file; /* config file where the condition is declared */ int line; /* line in the config file where the condition is declared */ }; diff --git a/src/cfgparse.c b/src/cfgparse.c index 8e582a627..e65f59db0 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1661,6 +1661,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) err_code |= ERR_ALERT | ERR_FATAL; goto out; } + cond->file = file; cond->line = linenum; curproxy->acl_requires |= cond->requires; LIST_ADDQ(&curproxy->block_cond, &cond->list); @@ -1787,6 +1788,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto out; } + cond->file = file; cond->line = linenum; curproxy->acl_requires |= cond->requires; rule = (struct redirect_rule *)calloc(1, sizeof(*rule)); @@ -1853,6 +1855,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto out; } + cond->file = file; cond->line = linenum; curproxy->acl_requires |= cond->requires; if (cond->requires & ACL_USE_RTR_ANY) { @@ -2339,6 +2342,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) err_code |= ERR_ALERT | ERR_FATAL; goto out; } + cond->file = file; cond->line = linenum; curproxy->acl_requires |= cond->requires; LIST_ADDQ(&curproxy->mon_fail_cond, &cond->list);