Project

General

Profile

Actions

Bug #2059

closed

Lighttpd PCRE-Result differs from PCREtest

Added by M3m0r3x about 15 years ago. Updated about 15 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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.

Actions #1

Updated by M3m0r3x about 15 years ago

  • Target version changed from 1.5.0 to 1.4.x
Actions #2

Updated by icy about 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.

Actions #3

Updated by M3m0r3x about 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.

Actions #4

Updated by jan about 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 ?

Actions #5

Updated by icy about 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|....)$

Actions #6

Updated by M3m0r3x about 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!

Actions #7

Updated by stbuehler about 15 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2614.

Actions #8

Updated by stbuehler about 15 years ago

  • Target version changed from 1.4.x to 1.4.24
Actions

Also available in: Atom