mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-10-26 14:10:59 +01:00
BUG/MINOR: pattern: Fix pattern lookup for map with opt@ prefix
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.
This commit is contained in:
parent
c325e34e6d
commit
7aa9f5ec98
@ -1537,9 +1537,11 @@ struct pat_ref *pat_ref_lookup(const char *reference)
|
|||||||
{
|
{
|
||||||
struct pat_ref *ref;
|
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)
|
if (strlen(reference) > 5 && strncmp(reference, "file@", 5) == 0)
|
||||||
reference += 5;
|
reference += 5;
|
||||||
|
else if (strlen(reference) > 4 && strncmp(reference, "opt@", 4) == 0)
|
||||||
|
reference += 4;
|
||||||
|
|
||||||
list_for_each_entry(ref, &pattern_reference, list)
|
list_for_each_entry(ref, &pattern_reference, list)
|
||||||
if (ref->reference && strcmp(reference, ref->reference) == 0)
|
if (ref->reference && strcmp(reference, ref->reference) == 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user