Project

General

Profile

Actions

Bug #557

closed

missing %0 used in configure will cause server silent crash

Added by Anonymous over 18 years ago. Updated over 17 years ago.

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

Description

Here is the configuration cause crash


$HTTP["useragent"] !~ "CoralWebPrx" {
  $HTTP["host"] !~ "\.something.tld$" {
        url.redirect = ( "^/(.*)\.(JPG|jpg|jpeg|mp3|swf|wmv|mov|mp4)$" => "http://%0.nyud.net:8080/$1.$2",
                )
  }
}

This configure will not cause any problem


$HTTP["useragent"] !~ "CoralWebPrx" {
  $HTTP["host"] !~ "\.something.tld$" {
        $HTTP["host"] =~ ".*" {
        url.redirect = ( "^/(.*)\.(JPG|jpg|jpeg|mp3|swf|wmv|mov|mp4)$" => "http://%0.nyud.net:8080/$1.$2",
                )
        }
  }
}

Server log, no error whatsoever. Server will shutdown itself once this configuration receives a matching request.


2006-03-02 22:57:21: (log.c.75) server started 
2006-03-02 22:58:04: (log.c.75) server started 
2006-03-02 22:59:04: (log.c.75) server started 

-- yejun

Actions #1

Updated by moo over 18 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

fixed in r1016

Actions #2

Updated by Anonymous over 17 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (fixed)

I just encountered this error once more in 1.4.12 (specifically, the FreeBSD package lighttpd-1.4.12 running on FreeBSD 6.2-RELEASE). I have also tested it on 1.4.13 (on Ubuntu Linux, package 1.4.13~r1370-1ubuntu1) as well, and the problem exists there as well.

Specifically, the configuration:


url.redirect = ( "^/admin/(.*)$" => "https://%0/postfixadmin/admin/$1",
                 "^/settings/(.*)$" => "https://%0/postfixadmin/users/$1" )

... silently dies when one of the redirects is encountered, but wrap it with `$HTTPhost =~ ".*"`, i.e.


$HTTP["host"] =~ ".*" {
     url.redirect = ( "^/admin/(.*)$" => "https://%0/postfixadmin/admin/$1",
                     "^/settings/(.*)$" => "https://%0/postfixadmin/users/$1" )
}

... and everything works fine.

The configuration that I used to replicate the problem on Ubuntu/1.4.13 was slightly different, because that server does not run https:


url.redirect = ( "^/admin/(.*)$" => "http://%0/postfixadmin/admin/$1",
                 "^/settings/(.*)$" => "http://%0/postfixadmin/users/$1" )

-- remi

Actions #3

Updated by hoffie over 17 years ago

1.4.12 is old and buggy, mentioned Ubuntu 1.4.13 package is not 1.4.13 but pre-1.4.13 (they use revision 1370, vanilla 1.4.13 is 1392).
So, please try with a recent version.
Maybe 1.4.13 is still affected (although I don't think so), so you could also try the 1.4.14 snapshot published yesterday (http://article.gmane.org/gmane.comp.web.lighttpd/4823)

BTW, regarding your second config snippet, url.redirect and url.rewrite are not supposed to work inside $HTTPhost conditionals (of course, if this crashes lighttpd as well, it's still a bug, just as a sidenote).

Actions #4

Updated by jan over 17 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to fixed

I can't repeat in r1734.

Actions

Also available in: Atom