mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-01 14:38:28 +00:00
BUG/MEDIUM: thread/http: Add missing locks in set-map and add-acl HTTP rules
Locks are missing in the rules "http-request set-map" and "http-response add-acl" when an acl or map update is performed. Pattern elements must be locked. This patch must be backported to 1.9 and 1.8. For the 1.8, the HTX part must be ignored.
This commit is contained in:
parent
22c57bef56
commit
e84289e585
@ -1750,12 +1750,14 @@ resume_execution:
|
||||
value->area[value->data] = '\0';
|
||||
|
||||
/* perform update */
|
||||
HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
|
||||
if (pat_ref_find_elt(ref, key->area) != NULL)
|
||||
/* update entry if it exists */
|
||||
pat_ref_set(ref, key->area, value->area, NULL);
|
||||
else
|
||||
/* insert a new entry */
|
||||
pat_ref_add(ref, key->area, value->area, NULL);
|
||||
HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
|
||||
|
||||
free_trash_chunk(key);
|
||||
free_trash_chunk(value);
|
||||
@ -2058,8 +2060,10 @@ resume_execution:
|
||||
|
||||
/* perform update */
|
||||
/* check if the entry already exists */
|
||||
HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
|
||||
if (pat_ref_find_elt(ref, key->area) == NULL)
|
||||
pat_ref_add(ref, key->area, NULL, NULL);
|
||||
HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
|
||||
|
||||
free_trash_chunk(key);
|
||||
break;
|
||||
|
@ -2977,13 +2977,14 @@ static enum rule_result htx_req_get_intercept_rule(struct proxy *px, struct list
|
||||
value->area[value->data] = '\0';
|
||||
|
||||
/* perform update */
|
||||
HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
|
||||
if (pat_ref_find_elt(ref, key->area) != NULL)
|
||||
/* update entry if it exists */
|
||||
pat_ref_set(ref, key->area, value->area, NULL);
|
||||
else
|
||||
/* insert a new entry */
|
||||
pat_ref_add(ref, key->area, value->area, NULL);
|
||||
|
||||
HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
|
||||
free_trash_chunk(key);
|
||||
free_trash_chunk(value);
|
||||
break;
|
||||
@ -3272,9 +3273,10 @@ resume_execution:
|
||||
|
||||
/* perform update */
|
||||
/* check if the entry already exists */
|
||||
HA_SPIN_LOCK(PATREF_LOCK, &ref->lock);
|
||||
if (pat_ref_find_elt(ref, key->area) == NULL)
|
||||
pat_ref_add(ref, key->area, NULL, NULL);
|
||||
|
||||
HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
|
||||
free_trash_chunk(key);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user