From 564960ff88ddf58b15acad60e3d5d06d84293c6a Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 11 Mar 2022 15:54:26 +0000 Subject: Set $value for match_ and inlist --- doc/doc-docbook/spec.xfpt | 25 +++++++++++++++++++++++++ doc/doc-txt/NewStuff | 4 ++++ 2 files changed, 29 insertions(+) (limited to 'doc') diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 1f0f473d8..105e2fc5d 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -11902,6 +11902,19 @@ ${if inlisti{Needle}{fOo:NeeDLE:bAr}} ${if forany{fOo:NeeDLE:bAr}{eqi{$item}{Needle}}} .endd +.new +The variable &$value$& will be set for a successful match and can be +used in the success clause of an &%if%& expansion item using the condition. +.cindex "tainted data" "de-tainting" +It will have the same taint status as the list; expansions such as +.code +${if inlist {$h_mycode:} {0 : 1 : 42} {$value}} +.endd +can be used for de-tainting. +Any previous &$value$& is restored after the if. +.wen + + .vitem &*isip&~{*&<&'string'&>&*}*& &&& &*isip4&~{*&<&'string'&>&*}*& &&& &*isip6&~{*&<&'string'&>&*}*& @@ -12098,6 +12111,18 @@ item can be used, as in all address lists, to cause subsequent items to have their local parts matched casefully. Domains are always matched caselessly. +.new +The variable &$value$& will be set for a successful match and can be +used in the success clause of an &%if%& expansion item using the condition. +.cindex "tainted data" "de-tainting" +It will have the same taint status as the list; expansions such as +.code +${if match_local_part {$local_part} {alice : bill : charlotte : dave} {$value}} +.endd +can be used for de-tainting. +Any previous &$value$& is restored after the if. +.wen + Note that <&'string2'&> is not itself subject to string expansion, unless Exim was built with the EXPAND_LISTMATCH_RHS option. diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 730508adc..11004e33a 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -23,6 +23,10 @@ Version 4.96 built using untrusted data ("tainted"). For now lack of quoting is merely logged; a future release will upgrade this to an error. + 7. The expansion conditions match_ and inlist now set $value for + the expansion of the "true" result of the ${if}. With a static list, this + can be used for de-tainting. + Version 4.95 ------------ -- cgit v1.2.3