When we look for a map file reference, the file@ prefix is removed because
if may be omitted. The same is true with opt@ prefix. However this case was
not properly performed in pat_ref_lookup(). Let's do so.
This patch must be backported as far as 3.0.
(cherry picked from commit
7aa9f5ec98436182b2b5ebeb57828d2daf27f20a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
0d07528f558509ee7b3d097e93842de2d6b273e1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
6da9abc77d9f77a438856d13c1db15c5dd86b5d8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
{
struct pat_ref *ref;
- /* Skip file@ prefix, it is the default case. Can be mixed with ref omitting the prefix */
+ /* Skip file@ or opt@ prefix, it is the default case. Can be mixed with ref omitting the prefix */
if (strlen(reference) > 5 && strncmp(reference, "file@", 5) == 0)
reference += 5;
+ else if (strlen(reference) > 4 && strncmp(reference, "opt@", 4) == 0)
+ reference += 4;
list_for_each_entry(ref, &pattern_reference, list)
if (ref->reference && strcmp(reference, ref->reference) == 0)