Bug #2059
closedLighttpd PCRE-Result differs from PCREtest
Description
Lighttpd is not able to match, but pcretest did:
$HTTP["host"] =~ "(^(www\.|)funkhaus\.com$|^(www\.|)gong\.info|^(www\.|)funkhausonline\.de|^(www\.|)funkhaus-online\.de|^(www\.|)festungsweinfest\.de|^(www\.|)festungs-weinfest\.de|^(www\.|)gongchat\.de|^(www\.|)gong-chat\.de|^(www\.|)funkhauswuerzburg\.de|^(www\.|)funkhaus-wuerzburg\.de|^(www2\.|)mainfranken\.com|^(www\.|)wuerzburg24\.de|^(www\.|)radiocharivari\.net|^(www\.|)radio-charivari\.net|^(www\.|)radiocharivari\.com|^(www\.|)radio-charivari\.com|^(www\.|)stellenmarktmainfranken\.de|^(www\.|)stellenmarkt-mainfranken\.de|^(www\.|)immomarktmainfranken\.de|^(www\.|)immomarkt-mainfranken\.de|^(www\.|)immobilienmarkt-mainfranken\.de$)" {
here the result of pcretest-tool: http://pastebin.com/m6c8f82f
and here the lighttpd-output: http://pastebin.com/m6af9f737
as you can see, lighttpd didn't match but pcretest-tool did.
I tried, Debian (Etch/Lenny/SID) and a self compiled 1.4.22, I also updated pcre but didn't change anything.
Updated by icy over 15 years ago
Do you have "!~" in your config instead of "=~"? The regex should match and I can't find any obvious bug in the code right now.
Updated by M3m0r3x over 15 years ago
No, I copy&pasted the above line directly out of my config-file.
Maybe it helps, but if I remove f.e. "^(www\.|)gong-chat\.de" lighttpds-regex-system is working, too (at least with the above domain). It's very strange.
I also checked for "hidden" chars and typed everything again, nothing changed.
Updated by jan over 15 years ago
M3m0r3x wrote:
No, I copy&pasted the above line directly out of my config-file.
Maybe it helps, but if I remove f.e. "^(www.|)gong-chat.de" lighttpds-regex-system is working, too (at least with the above domain). It's very strange.
Can you try if using (?:...) instead of (...) solves the problem ?
Updated by icy over 15 years ago
There's an internal limit on how many matches lighty can work with. You are hitting it.
Unfortunately the current code does not output any error in this case. As a quick workaround, use what jan suggested or rewrite the regex like this:
^(www\.)?(funkhaus\.com|gong\.de|....)$
Updated by M3m0r3x over 15 years ago
icy wrote:
There's an internal limit on how many matches lighty can work with. You are hitting it.
Unfortunately the current code does not output any error in this case. As a quick workaround, use what jan suggested or rewrite the regex like this:
^(www.)?(funkhaus.com|gong.de|....)$
I tried:
$HTTP["host"] =~ "(?:^(www\.|)funkhaus\.com$|^(www\.|)gong\.info|^(www\.|)funkhausonline\.de|^(www\.|)funkhaus-online\.de|^(www\.|)festungsweinfest\.de|^(www\.|)festungs-weinfest\.de|^(www\.|)gongchat\.de|^(www\.|)gong-chat\.de|^(www\.|)funkhauswuerzburg\.de|^(www\.|)funkhaus-wuerzburg\.de|^(www2\.|)mainfranken\.com|^(www\.|)wuerzburg24\.de|^(www\.|)radiocharivari\.net|^(www\.|)radio-charivari\.net|^(www\.|)radiocharivari\.com|^(www\.|)radio-charivari\.com|^(www\.|)stellenmarktmainfranken\.de|^(www\.|)stellenmarkt-mainfranken\.de|^(www\.|)immomarktmainfranken\.de|^(www\.|)immomarkt-mainfranken\.de|^(www\.|)immobilienmarkt-mainfranken\.de$)" {
but didn't help.
$HTTP["host"] =~ "(?:^(?:www\.|)funkhaus\.com$|^(?:www\.|)gong\.info|^(?:www\.|)funkhausonline\.de|^(?:www\.|)funkhaus-online\.de|^(?:www\.|)festungsweinfest\.de|^(?:www\.|)festungs-weinfest\.de|^(?:www\.|)gongchat\.de|^(?:www\.|)gong-chat\.de|^(?:www\.|)funkhauswuerzburg\.de|^(?:www\.|)funkhaus-wuerzburg\.de|^(?:www2\.|)mainfranken\.com|^(?:www\.|)wuerzburg24\.de|^(?:www\.|)radiocharivari\.net|^(?:www\.|)radio-charivari\.net|^(?:www\.|)radiocharivari\.com|^(?:www\.|)radio-charivari\.com|^(?:www\.|)stellenmarktmainfranken\.de|^(?:www\.|)stellenmarkt-mainfranken\.de|^(?:www\.|)immomarktmainfranken\.de|^(?:www\.|)immomarkt-mainfranken\.de|^(?:www\.|)immobilienmarkt-mainfranken\.de$)"
is working. I will create a patch for syscp to get this "fixed" for everybody using syscp, maybe increasing the limit would be a good idea, too.
Thanks a lot!
Updated by stbuehler over 15 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset r2614.
Updated by stbuehler about 15 years ago
- Target version changed from 1.4.x to 1.4.24
Also available in: Atom