]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: Allow to use if/unless conditionnals for do-log action
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jan 2025 08:44:06 +0000 (09:44 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jan 2025 08:44:08 +0000 (09:44 +0100)
The do-log action does not accept argument for now. But an error was
triggered if any extra arguments was found, preventing the use of if/unless
conditionnals.

When an action is parsed, expected arguments must be tested to detect
missing ones but not unexpected extra arguments because this should be
performed by the conditionnal parser. So just removing the test in the
do-log parser function is enough to fix the issue.

This patch must be backported to 3.1.

src/log.c

index 441e692850507d558cc59165955f9d96e2c17a1e..90b5645cb2e60c5c5407f80895accaf027d56a33 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -6791,11 +6791,6 @@ enum act_parse_ret do_log_parse_act(enum log_orig_id id,
                                     const char **args, int *orig_arg, struct proxy *px,
                                     struct act_rule *rule, char **err)
 {
-       if (*args[*orig_arg]) {
-               memprintf(err, "doesn't expects any argument");
-               return ACT_RET_PRS_ERR;
-       }
-
        rule->action_ptr = do_log_action;
        rule->action = ACT_CUSTOM;
        rule->release_ptr = NULL;