From: Alan T. DeKok Date: Mon, 18 Jan 2016 20:23:23 +0000 (-0500) Subject: Attribute contents on the LHS of regexes are not escaped X-Git-Tag: release_3_0_11~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b393ebda99cab430215cbc602697cf61b09a6ee;p=thirdparty%2Ffreeradius-server.git Attribute contents on the LHS of regexes are not escaped --- diff --git a/src/tests/keywords/regex-lhs b/src/tests/keywords/regex-lhs new file mode 100644 index 00000000000..91b0b2078b5 --- /dev/null +++ b/src/tests/keywords/regex-lhs @@ -0,0 +1,27 @@ +# +# PRE: update if regex-escape +# + +# +# Strings which are expanded in a regex have regex special +# characters escaped. Because the input strings are unsafe. +# +update request { + Tmp-String-0 := "example.com" + Tmp-String-1 := "^foo$bar" +} + +if (&Tmp-String-0 !~ /example\.com$/) { + update reply { + Filter-Id := "fail 1" + } +} +elsif (&Tmp-String-1 !~ /\^foo\$bar/) { + update reply { + Filter-Id := "fail 1" + } +} else { + update reply { + Filter-Id := "filter" + } +} \ No newline at end of file