Ticket #1164 (closed defect: fixed)

Opened 1 year ago

Last modified 3 months ago

mod_extforward breaks (at least) URL matching

Reported by: kangur@polcom.net Assigned to: jan
Priority: high Milestone: 1.4.19
Component: core Version: 1.4.18
Severity: major Keywords: mod_extforward patch
Cc: Blocking:
Need Feedback: 0

Description

When one loads mod_extforward (no need to set trusted proxies) and then tries to match URLs with regular expressions it always returns false. It is quite possible that not only that is broken but I don't have the time to test it right now.

More info available on request. I reported against core because I can't find that module in the list. Please fix ASAP because it is major problem in my setup. Thanks.

Attachments

Change History

05/16/2007 05:12:01 PM changed by kangur@polcom.net

NOT working config:

# lighttpd -pf /etc/lighttpd.d/lists.conf
config {
    var.PID                    = 23909
    var.CWD                    = "/root"
    var.PORT                   = 30011
    var.HOST                   = "lists.lp.pl"
    var.USER                   = "lists"
    var.UID                    = 4011
    var.GROUP                  = "webusers"
    debug.log-request-handling = "enable"
    var.BASE_DIR               = "/srv/4011"
    var.WWW_DIR                = "/srv/4011/www"
    var.LOG_DIR                = "/srv/4011/log"
    var.PID_DIR                = "/srv/4011/pid"
    server.pid-file            = "/srv/4011/pid/lighttpd.pid"
    server.bind                = "127.0.0.1"
    server.port                = 30011
    server.document-root       = "/srv/4011/www"
    server.event-handler       = "linux-sysepoll"
    server.errorlog            = "/srv/4011/log/error.log"
    server.username            = "lists"
    server.groupname           = "webusers"
    server.modules             = (
        "mod_indexfile",
        "mod_accesslog",
        "mod_extforward",
        "mod_compress",
        "mod_alias",
        "mod_cgi",
        "mod_dirlisting",
        "mod_staticfile",
        # 8
    )
    accesslog.filename         = "/srv/4011/log/access.log"
    dir-listing.activate       = "disable"
    index-file.names           = ("index.html", "index.php")
    mimetype.assign            = (
        ".pdf"     => "application/pdf",
        ".sig"     => "application/pgp-signature",
        ".spl"     => "application/futuresplash",
        ".class"   => "application/octet-stream",
        ".ps"      => "application/postscript",
        # 5
        ".torrent" => "application/x-bittorrent",
        ".dvi"     => "application/x-dvi",
        ".gz"      => "application/x-gzip",
        ".pac"     => "application/x-ns-proxy-autoconfig",
        ".swf"     => "application/x-shockwave-flash",
        # 10
        ".tar.gz"  => "application/x-tgz",
        ".tgz"     => "application/x-tgz",
        ".tar"     => "application/x-tar",
        ".zip"     => "application/zip",
        ".mp3"     => "audio/mpeg",
        # 15
        ".m3u"     => "audio/x-mpegurl",
        ".wma"     => "audio/x-ms-wma",
        ".wax"     => "audio/x-ms-wax",
        ".ogg"     => "application/ogg",
        ".wav"     => "audio/x-wav",
        # 20
        ".gif"     => "image/gif",
        ".jpg"     => "image/jpeg",
        ".jpeg"    => "image/jpeg",
        ".png"     => "image/png",
        ".xbm"     => "image/x-xbitmap",
        # 25
        ".xpm"     => "image/x-xpixmap",
        ".xwd"     => "image/x-xwindowdump",
        ".css"     => "text/css",
        ".html"    => "text/html",
        ".htm"     => "text/html",
        # 30
        ".js"      => "text/javascript",
        ".asc"     => "text/plain",
        ".c"       => "text/plain",
        ".h"       => "text/plain",
        ".cc"      => "text/plain",
        # 35
        ".cpp"     => "text/plain",
        ".hh"      => "text/plain",
        ".hpp"     => "text/plain",
        ".conf"    => "text/plain",
        ".log"     => "text/plain",
        # 40
        ".text"    => "text/plain",
        ".txt"     => "text/plain",
        ".diff"    => "text/plain",
        ".patch"   => "text/plain",
        ".ebuild"  => "text/plain",
        # 45
        ".eclass"  => "text/plain",
        ".rtf"     => "application/rtf",
        ".bmp"     => "image/bmp",
        ".tif"     => "image/tiff",
        ".tiff"    => "image/tiff",
        # 50
        ".ico"     => "image/x-icon",
        ".dtd"     => "text/xml",
        ".xml"     => "text/xml",
        ".mpeg"    => "video/mpeg",
        ".mpg"     => "video/mpeg",
        # 55
        ".mov"     => "video/quicktime",
        ".qt"      => "video/quicktime",
        ".avi"     => "video/x-msvideo",
        ".asf"     => "video/x-ms-asf",
        ".asx"     => "video/x-ms-asf",
        # 60
        ".wmv"     => "video/x-ms-wmv",
        ".bz2"     => "application/x-bzip",
        ".tbz"     => "application/x-bzip-compressed-tar",
        ".tar.bz2" => "application/x-bzip-compressed-tar",
        # 64
    )
    extforward.forwarder       = (
        "127.0.0.1" => "trust",
    )
    compress.filetype          = ("text/plain", "text/html", "text/css", "text/javascript", "text/xml")
    alias.url                  = (
        "/mailman"   => "/usr/local/mailman/cgi-bin",
        "/icons"     => "/usr/local/mailman/icons",
        "/pipermail" => "/usr/local/mailman/archives/public",
        # 3
    )


    $HTTP["url"] =~ "^/mailman/" {
        # block 1
        server.indexfiles = ("listinfo")
        cgi.assign        = (
            "" => "",
        )

    } # end of $HTTP["url"] =~ "^/mailman/"
    else $HTTP["url"] =~ "^/pipermail/" {
        # block 2
        dir-listing.activate      = "enable"
        dir-listing.hide-dotfiles = "enable"
        server.follow-symlink     = "enable"

    } # end of $HTTP["url"] =~ "^/pipermail/"
}

Logs from using it:

==> /srv/4011/log/access.log <==
87.205.207.250 lists.lp.pl - [16/May/2007:19:10:40 +0200] "GET /mailman/listinfo HTTP/1.0" 200 17349 "-" "Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.1.3) Gecko/20070403 BonEcho/2.0.0.3"

==> /srv/4011/log/error.log <==
2007-05-16 19:10:40: (response.c.205) -- splitting Request-URI
2007-05-16 19:10:40: (response.c.206) Request-URI  :  /mailman/listinfo
2007-05-16 19:10:40: (response.c.207) URI-scheme   :  http
2007-05-16 19:10:40: (response.c.208) URI-authority:  lists.lp.pl
2007-05-16 19:10:40: (response.c.209) URI-path     :  /mailman/listinfo
2007-05-16 19:10:40: (response.c.210) URI-query    :
2007-05-16 19:10:40: (mod_extforward.c.349) -- mod_extforward_uri_handler called
2007-05-16 19:10:40: (mod_extforward.c.405) using address: 87.205.207.250
2007-05-16 19:10:40: (mod_extforward.c.442) patching con->dst_addr_buf for the accesslog: 87.205.207.250
2007-05-16 19:10:40: (response.c.260) -- sanatising URI
2007-05-16 19:10:40: (response.c.261) URI-path     :  /mailman/listinfo
2007-05-16 19:10:40: (response.c.375) -- before doc_root
2007-05-16 19:10:40: (response.c.376) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.377) Rel-Path     : /mailman/listinfo
2007-05-16 19:10:40: (response.c.378) Path         :
2007-05-16 19:10:40: (response.c.426) -- after doc_root
2007-05-16 19:10:40: (response.c.427) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.428) Rel-Path     : /mailman/listinfo
2007-05-16 19:10:40: (response.c.429) Path         : /srv/4011/www/mailman/listinfo
2007-05-16 19:10:40: (response.c.446) -- logical -> physical
2007-05-16 19:10:40: (response.c.447) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.448) Rel-Path     : /mailman/listinfo
2007-05-16 19:10:40: (response.c.449) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:10:40: (response.c.466) -- handling physical path
2007-05-16 19:10:40: (response.c.467) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:10:40: (response.c.474) -- file found
2007-05-16 19:10:40: (response.c.475) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:10:40: (response.c.613) -- handling subrequest
2007-05-16 19:10:40: (response.c.614) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:10:40: (mod_staticfile.c.387) -- handling file as static file
2007-05-16 19:10:40: (response.c.625) -- subrequest finished
2007-05-16 19:10:40: (response.c.205) -- splitting Request-URI
2007-05-16 19:10:40: (response.c.206) Request-URI  :  /favicon.ico
2007-05-16 19:10:40: (response.c.207) URI-scheme   :  http
2007-05-16 19:10:40: (response.c.208) URI-authority:  lists.lp.pl
2007-05-16 19:10:40: (response.c.209) URI-path     :  /favicon.ico
2007-05-16 19:10:40: (response.c.210) URI-query    :
2007-05-16 19:10:40: (mod_extforward.c.349) -- mod_extforward_uri_handler called
2007-05-16 19:10:40: (mod_extforward.c.405) using address: 87.205.207.250
2007-05-16 19:10:40: (mod_extforward.c.442) patching con->dst_addr_buf for the accesslog: 87.205.207.250
2007-05-16 19:10:40: (response.c.260) -- sanatising URI
2007-05-16 19:10:40: (response.c.261) URI-path     :  /favicon.ico
2007-05-16 19:10:40: (response.c.375) -- before doc_root
2007-05-16 19:10:40: (response.c.376) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.377) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.378) Path         :
2007-05-16 19:10:40: (response.c.426) -- after doc_root
2007-05-16 19:10:40: (response.c.427) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.428) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.429) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.446) -- logical -> physical
2007-05-16 19:10:40: (response.c.447) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.448) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.449) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.466) -- handling physical path
2007-05-16 19:10:40: (response.c.467) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.523) -- file not found
2007-05-16 19:10:40: (response.c.524) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.205) -- splitting Request-URI
2007-05-16 19:10:40: (response.c.206) Request-URI  :  /favicon.ico
2007-05-16 19:10:40: (response.c.207) URI-scheme   :  http
2007-05-16 19:10:40: (response.c.208) URI-authority:  lists.lp.pl
2007-05-16 19:10:40: (response.c.209) URI-path     :  /favicon.ico
2007-05-16 19:10:40: (response.c.210) URI-query    :
2007-05-16 19:10:40: (mod_extforward.c.349) -- mod_extforward_uri_handler called
2007-05-16 19:10:40: (mod_extforward.c.405) using address: 87.205.207.250
2007-05-16 19:10:40: (mod_extforward.c.442) patching con->dst_addr_buf for the accesslog: 87.205.207.250
2007-05-16 19:10:40: (response.c.260) -- sanatising URI
2007-05-16 19:10:40: (response.c.261) URI-path     :  /favicon.ico
2007-05-16 19:10:40: (response.c.375) -- before doc_root
2007-05-16 19:10:40: (response.c.376) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.377) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.378) Path         :
2007-05-16 19:10:40: (response.c.426) -- after doc_root
2007-05-16 19:10:40: (response.c.427) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.428) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.429) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.446) -- logical -> physical
2007-05-16 19:10:40: (response.c.447) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.448) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.449) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.466) -- handling physical path
2007-05-16 19:10:40: (response.c.467) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.523) -- file not found
2007-05-16 19:10:40: (response.c.524) Path         : /srv/4011/www/favicon.ico

(follow-up: ↓ 17 ) 05/16/2007 05:14:54 PM changed by kangur@polcom.net

Working config (without mod_extforward):

# lighttpd -pf /etc/lighttpd.d/lists.conf
config {
    var.PID                    = 27659
    var.CWD                    = "/root"
    var.PORT                   = 30011
    var.HOST                   = "lists.lp.pl"
    var.USER                   = "lists"
    var.UID                    = 4011
    var.GROUP                  = "webusers"
    debug.log-request-handling = "enable"
    var.BASE_DIR               = "/srv/4011"
    var.WWW_DIR                = "/srv/4011/www"
    var.LOG_DIR                = "/srv/4011/log"
    var.PID_DIR                = "/srv/4011/pid"
    server.pid-file            = "/srv/4011/pid/lighttpd.pid"
    server.bind                = "127.0.0.1"
    server.port                = 30011
    server.document-root       = "/srv/4011/www"
    server.event-handler       = "linux-sysepoll"
    server.errorlog            = "/srv/4011/log/error.log"
    server.username            = "lists"
    server.groupname           = "webusers"
    server.modules             = (
        "mod_indexfile",
        "mod_accesslog",
        "mod_compress",
        "mod_alias",
        "mod_cgi",
        "mod_dirlisting",
        "mod_staticfile",
        # 7
    )
    accesslog.filename         = "/srv/4011/log/access.log"
    dir-listing.activate       = "disable"
    index-file.names           = ("index.html", "index.php")
    mimetype.assign            = (
        ".pdf"     => "application/pdf",
        ".sig"     => "application/pgp-signature",
        ".spl"     => "application/futuresplash",
        ".class"   => "application/octet-stream",
        ".ps"      => "application/postscript",
        # 5
        ".torrent" => "application/x-bittorrent",
        ".dvi"     => "application/x-dvi",
        ".gz"      => "application/x-gzip",
        ".pac"     => "application/x-ns-proxy-autoconfig",
        ".swf"     => "application/x-shockwave-flash",
        # 10
        ".tar.gz"  => "application/x-tgz",
        ".tgz"     => "application/x-tgz",
        ".tar"     => "application/x-tar",
        ".zip"     => "application/zip",
        ".mp3"     => "audio/mpeg",
        # 15
        ".m3u"     => "audio/x-mpegurl",
        ".wma"     => "audio/x-ms-wma",
        ".wax"     => "audio/x-ms-wax",
        ".ogg"     => "application/ogg",
        ".wav"     => "audio/x-wav",
        # 20
        ".gif"     => "image/gif",
        ".jpg"     => "image/jpeg",
        ".jpeg"    => "image/jpeg",
        ".png"     => "image/png",
        ".xbm"     => "image/x-xbitmap",
        # 25
        ".xpm"     => "image/x-xpixmap",
        ".xwd"     => "image/x-xwindowdump",
        ".css"     => "text/css",
        ".html"    => "text/html",
        ".htm"     => "text/html",
        # 30
        ".js"      => "text/javascript",
        ".asc"     => "text/plain",
        ".c"       => "text/plain",
        ".h"       => "text/plain",
        ".cc"      => "text/plain",
        # 35
        ".cpp"     => "text/plain",
        ".hh"      => "text/plain",
        ".hpp"     => "text/plain",
        ".conf"    => "text/plain",
        ".log"     => "text/plain",
        # 40
        ".text"    => "text/plain",
        ".txt"     => "text/plain",
        ".diff"    => "text/plain",
        ".patch"   => "text/plain",
        ".ebuild"  => "text/plain",
        # 45
        ".eclass"  => "text/plain",
        ".rtf"     => "application/rtf",
        ".bmp"     => "image/bmp",
        ".tif"     => "image/tiff",
        ".tiff"    => "image/tiff",
        # 50
        ".ico"     => "image/x-icon",
        ".dtd"     => "text/xml",
        ".xml"     => "text/xml",
        ".mpeg"    => "video/mpeg",
        ".mpg"     => "video/mpeg",
        # 55
        ".mov"     => "video/quicktime",
        ".qt"      => "video/quicktime",
        ".avi"     => "video/x-msvideo",
        ".asf"     => "video/x-ms-asf",
        ".asx"     => "video/x-ms-asf",
        # 60
        ".wmv"     => "video/x-ms-wmv",
        ".bz2"     => "application/x-bzip",
        ".tbz"     => "application/x-bzip-compressed-tar",
        ".tar.bz2" => "application/x-bzip-compressed-tar",
        # 64
    )
    compress.filetype          = ("text/plain", "text/html", "text/css", "text/javascript", "text/xml")
    alias.url                  = (
        "/mailman"   => "/usr/local/mailman/cgi-bin",
        "/icons"     => "/usr/local/mailman/icons",
        "/pipermail" => "/usr/local/mailman/archives/public",
        # 3
    )


    $HTTP["url"] =~ "^/mailman/" {
        # block 1
        server.indexfiles = ("listinfo")
        cgi.assign        = (
            "" => "",
        )

    } # end of $HTTP["url"] =~ "^/mailman/"
    else $HTTP["url"] =~ "^/pipermail/" {
        # block 2
        dir-listing.activate      = "enable"
        dir-listing.hide-dotfiles = "enable"
        server.follow-symlink     = "enable"

    } # end of $HTTP["url"] =~ "^/pipermail/"
}

Logs from using it:

==> /srv/4011/log/error.log <==
2007-05-16 19:10:40: (response.c.446) -- logical -> physical
2007-05-16 19:10:40: (response.c.447) Doc-Root     : /srv/4011/www
2007-05-16 19:10:40: (response.c.448) Rel-Path     : /favicon.ico
2007-05-16 19:10:40: (response.c.449) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.466) -- handling physical path
2007-05-16 19:10:40: (response.c.467) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:10:40: (response.c.523) -- file not found
2007-05-16 19:10:40: (response.c.524) Path         : /srv/4011/www/favicon.ico
2007-05-16 19:12:57: (log.c.196) server stopped
2007-05-16 19:14:01: (log.c.136) server started
2007-05-16 19:14:10: (response.c.205) -- splitting Request-URI
2007-05-16 19:14:10: (response.c.206) Request-URI  :  /mailman/listinfo
2007-05-16 19:14:10: (response.c.207) URI-scheme   :  http
2007-05-16 19:14:10: (response.c.208) URI-authority:  lists.lp.pl
2007-05-16 19:14:10: (response.c.209) URI-path     :  /mailman/listinfo
2007-05-16 19:14:10: (response.c.210) URI-query    :
2007-05-16 19:14:10: (response.c.260) -- sanatising URI
2007-05-16 19:14:10: (response.c.261) URI-path     :  /mailman/listinfo
2007-05-16 19:14:10: (response.c.375) -- before doc_root
2007-05-16 19:14:10: (response.c.376) Doc-Root     : /srv/4011/www
2007-05-16 19:14:10: (response.c.377) Rel-Path     : /mailman/listinfo
2007-05-16 19:14:10: (response.c.378) Path         :
2007-05-16 19:14:10: (response.c.426) -- after doc_root
2007-05-16 19:14:10: (response.c.427) Doc-Root     : /srv/4011/www
2007-05-16 19:14:10: (response.c.428) Rel-Path     : /mailman/listinfo
2007-05-16 19:14:10: (response.c.429) Path         : /srv/4011/www/mailman/listinfo
2007-05-16 19:14:10: (response.c.446) -- logical -> physical
2007-05-16 19:14:10: (response.c.447) Doc-Root     : /srv/4011/www
2007-05-16 19:14:10: (response.c.448) Rel-Path     : /mailman/listinfo
2007-05-16 19:14:10: (response.c.449) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:14:10: (response.c.466) -- handling physical path
2007-05-16 19:14:10: (response.c.467) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:14:10: (response.c.474) -- file found
2007-05-16 19:14:10: (response.c.475) Path         : /usr/local/mailman/cgi-bin/listinfo
2007-05-16 19:14:10: (response.c.613) -- handling subrequest
2007-05-16 19:14:10: (response.c.614) Path         : /usr/local/mailman/cgi-bin/listinfo

==> /srv/4011/log/access.log <==
127.0.0.1 lists.lp.pl - [16/May/2007:19:14:10 +0200] "GET /mailman/listinfo HTTP/1.0" 200 2000 "-" "Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.1.3) Gecko/20070403 BonEcho/2.0.0.3"

07/20/2007 06:58:47 PM changed by ts77

Thats currently a showstopper for me too. Any progress or ideas about it?

08/09/2007 11:25:00 PM changed by blueyed

  • pending changed.

I can confirm this.

Using an empty url match ($HTTPurl? =~ "") works, but will always match.

I've actually traced it down before finding this bug report and here's the config I came up with to reproduce it:

server.modules = (
    "mod_extforward",
    "mod_access",
)
server.document-root           = "/var/www"
server.port                    = 888

index-file.names = ("index.html")

$HTTP["url"] =~ "index" {
        url.access-deny  = ("")
}

Requesting http://localhost:888/index.html will be OK in this case, unless you remove mod_extforward.

I'm using 1.4.16-2ubuntu1.

My workaround was to use subdomains instead of subdirectories for this particular project.

08/16/2007 02:33:27 PM changed by ts77

  • version changed from 1.4.15 to 1.4.16.

it shows in 1.4.16 too, bumping version-flag.

08/23/2007 01:16:02 PM changed by anonymous

  • priority changed from normal to highest.
  • severity changed from major to critical.

can you please please please fix this issue... it's the most annoying of the bugs right now.

08/23/2007 01:23:53 PM changed by darix

  • priority changed from highest to normal.
  • severity changed from critical to normal.

08/26/2007 11:24:24 PM changed by misiolap

lighttpd-1.4.17.r1956.tar.gz - still doesn't work for me

(follow-up: ↓ 10 ) 08/27/2007 11:19:22 AM changed by cahe

  • priority changed from normal to highest.
  • severity changed from normal to major.

yep, doesn't work for me either. please fix this bug, it's killing me.. :(

(in reply to: ↑ 9 ) 08/27/2007 11:40:56 AM changed by cahe

  • priority changed from highest to high.

Replying to cahe:

yep, doesn't work for me either. please fix this bug, it's killing me.. :(

we've done some further testing and it seems, that the *fix* works, but only once - i thought it was my browsers cache, but after testing it with curl i'm quite sure, on 1.4.17, when the page is requested for the first time, the $HTTPurl? conditional works fine, but afterwards it breaks and doesn't work at all.

it's an improvement! ;-)

(follow-up: ↓ 12 ) 08/29/2007 11:12:31 AM changed by cahe&misolap

Okey... the patch provided by darix SHOULD solve the problem - it doesn't let lighty to cache conditionals UNTIL URL is parsed. by why does it work only one time and then collapses? no idea. if somebody solves this question we're there - otherwise it's business as usual.

(in reply to: ↑ 11 ) 08/29/2007 11:42:15 AM changed by Misiolap

lighttpd seems to alloc few connection structures on first connection, and then re-uses it - without resetting connection.conditional_is_valid

Patch for darix version:

--- response.c.old 2007-04-13 22:47:40.000000000 +0200 +++ response.c 2007-08-29 13:36:30.000000000 +0200 @@ -136,8 +136,13 @@

/* no decision yet, build conf->filename */ if (con->mode == DIRECT && con->physical.path->used == 0) {

char *qstr;

+ size_t i; + for(i = 0; i < COMP_LAST_ELEMENT; ++i) { + con->conditional_is_valid[i] = 0; + } +

/* we only come here when we have the parse the full request again

*

  • a HANDLER_COMEBACK from mod_rewrite and mod_fastcgi might be a
  • problem here as mod_setenv might get called multiple times

08/29/2007 11:44:09 AM changed by Misiolap

Sorry for posting rubbish. re-posting patch:

--- response.c.old      2007-04-13 22:47:40.000000000 +0200
+++ response.c  2007-08-29 13:36:30.000000000 +0200
@@ -136,8 +136,13 @@
        /* no decision yet, build conf->filename */
        if (con->mode == DIRECT && con->physical.path->used == 0) {
                char *qstr;
 
+               size_t i;
+               for(i = 0; i < COMP_LAST_ELEMENT; ++i) {
+                       con->conditional_is_valid[i] = 0;
+               }
+
                /* we only come here when we have the parse the full request again
                 *
                 * a HANDLER_COMEBACK from mod_rewrite and mod_fastcgi might be a
                 * problem here as mod_setenv might get called multiple times

08/30/2007 02:36:51 PM changed by anonymous

it fucking works :D

09/01/2007 09:31:57 PM changed by ts77

too bad that the final fix didn't make it in 1.4.17 :(

09/14/2007 04:18:53 PM changed by kangur@polcom.net

  • version changed from 1.4.16 to 1.4.18.

Looks like some mistake or spam with the attachment above...

Anyway: Could some lighttpd dev _please_ review, sanity-check and commit that patch? Or at least tell us why it is wrong... Or anything... Thanks'''

This bug has 4 months and it is a major PITA for many setups.

(in reply to: ↑ 2 ) 09/21/2007 03:10:57 AM changed by anonymous

Replying to kangur@polcom.net:

Working config (without mod_extforward): {{{ # lighttpd -pf /etc/lighttpd.d/lists.conf config { var.PID = 27659 var.CWD = "/root" var.PORT = 30011 var.HOST = "lists.lp.pl" var.USER = "lists" var.UID = 4011 var.GROUP = "webusers" debug.log-request-handling = "enable" var.BASE_DIR = "/srv/4011" var.WWW_DIR = "/srv/4011/www" var.LOG_DIR = "/srv/4011/log" var.PID_DIR = "/srv/4011/pid" server.pid-file = "/srv/4011/pid/lighttpd.pid" server.bind = "127.0.0.1" server.port = 30011 server.document-root = "/srv/4011/www" server.event-handler = "linux-sysepoll" server.errorlog = "/srv/4011/log/error.log" server.username = "lists" server.groupname = "webusers" server.modules = ( "mod_indexfile", "mod_accesslog", "mod_compress", "mod_alias", "mod_cgi", "mod_dirlisting", "mod_staticfile", # 7 ) accesslog.filename = "/srv/4011/log/access.log" dir-listing.activate = "disable" index-file.names = ("index.html", "index.php") mimetype.assign = ( ".pdf" => "application/pdf", ".sig" => "application/pgp-signature", ".spl" => "application/futuresplash", ".class" => "application/octet-stream", ".ps" => "application/postscript", # 5 ".torrent" => "application/x-bittorrent", ".dvi" => "application/x-dvi", ".gz" => "application/x-gzip", ".pac" => "application/x-ns-proxy-autoconfig", ".swf" => "application/x-shockwave-flash", # 10 ".tar.gz" => "application/x-tgz", ".tgz" => "application/x-tgz", ".tar" => "application/x-tar", ".zip" => "application/zip", ".mp3" => "audio/mpeg", # 15 ".m3u" => "audio/x-mpegurl", ".wma" => "audio/x-ms-wma", ".wax" => "audio/x-ms-wax", ".ogg" => "application/ogg", ".wav" => "audio/x-wav", # 20 ".gif" => "image/gif", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".png" => "image/png", ".xbm" => "image/x-xbitmap", # 25 ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", # 30 ".js" => "text/javascript", ".asc" => "text/plain", ".c" => "text/plain", ".h" => "text/plain", ".cc" => "text/plain", # 35 ".cpp" => "text/plain", ".hh" => "text/plain", ".hpp" => "text/plain", ".conf" => "text/plain", ".log" => "text/plain", # 40 ".text" => "text/plain", ".txt" => "text/plain", ".diff" => "text/plain", ".patch" => "text/plain", ".ebuild" => "text/plain", # 45 ".eclass" => "text/plain", ".rtf" => "application/rtf", ".bmp" => "image/bmp", ".tif" => "image/tiff", ".tiff" => "image/tiff", # 50 ".ico" => "image/x-icon", ".dtd" => "text/xml", ".xml" => "text/xml", ".mpeg" => "video/mpeg", ".mpg" => "video/mpeg", # 55 ".mov" => "video/quicktime", ".qt" => "video/quicktime", ".avi" => "video/x-msvideo", ".asf" => "video/x-ms-asf", ".asx" => "video/x-ms-asf", # 60 ".wmv" => "video/x-ms-wmv", ".bz2" => "application/x-bzip", ".tbz" => "application/x-bzip-compressed-tar", ".tar.bz2" => "application/x-bzip-compressed-tar", # 64 ) compress.filetype = ("text/plain", "text/html", "text/css", "text/javascript", "text/xml") alias.url = ( "/mailman" => "/usr/local/mailman/cgi-bin", "/icons" => "/usr/local/mailman/icons", "/pipermail" => "/usr/local/mailman/archives/public", # 3 ) $HTTPurl? =~ "/mailman/" { # block 1 server.indexfiles = ("listinfo") cgi.assign = ( "" => "", ) } # end of $HTTPurl? =~ "/mailman/" else $HTTPurl? =~ "/pipermail/" { # block 2 dir-listing.activate = "enable" dir-listing.hide-dotfiles = "enable" server.follow-symlink = "enable" } # end of $HTTPurl? =~ "/pipermail/" } }}} Logs from using it: {{{ ==> /srv/4011/log/error.log <== 2007-05-16 19:10:40: (response.c.446) -- logical -> physical 2007-05-16 19:10:40: (response.c.447) Doc-Root : /srv/4011/www 2007-05-16 19:10:40: (response.c.448) Rel-Path : /favicon.ico 2007-05-16 19:10:40: (response.c.449) Path : /srv/4011/www/favicon.ico 2007-05-16 19:10:40: (response.c.466) -- handling physical path 2007-05-16 19:10:40: (response.c.467) Path : /srv/4011/www/favicon.ico 2007-05-16 19:10:40: (response.c.523) -- file not found 2007-05-16 19:10:40: (response.c.524) Path : /srv/4011/www/favicon.ico 2007-05-16 19:12:57: (log.c.196) server stopped 2007-05-16 19:14:01: (log.c.136) server started 2007-05-16 19:14:10: (response.c.205) -- splitting Request-URI 2007-05-16 19:14:10: (response.c.206) Request-URI : /mailman/listinfo 2007-05-16 19:14:10: (response.c.207) URI-scheme : http 2007-05-16 19:14:10: (response.c.208) URI-authority: lists.lp.pl 2007-05-16 19:14:10: (response.c.209) URI-path : /mailman/listinfo 2007-05-16 19:14:10: (response.c.210) URI-query : 2007-05-16 19:14:10: (response.c.260) -- sanatising URI 2007-05-16 19:14:10: (response.c.261) URI-path : /mailman/listinfo 2007-05-16 19:14:10: (response.c.375) -- before doc_root 2007-05-16 19:14:10: (response.c.376) Doc-Root : /srv/4011/www 2007-05-16 19:14:10: (response.c.377) Rel-Path : /mailman/listinfo 2007-05-16 19:14:10: (response.c.378) Path : 2007-05-16 19:14:10: (response.c.426) -- after doc_root 2007-05-16 19:14:10: (response.c.427) Doc-Root : /srv/4011/www 2007-05-16 19:14:10: (response.c.428) Rel-Path : /mailman/listinfo 2007-05-16 19:14:10: (response.c.429) Path : /srv/4011/www/mailman/listinfo 2007-05-16 19:14:10: (response.c.446) -- logical -> physical 2007-05-16 19:14:10: (response.c.447) Doc-Root : /srv/4011/www 2007-05-16 19:14:10: (response.c.448) Rel-Path : /mailman/listinfo 2007-05-16 19:14:10: (response.c.449) Path : /usr/local/mailman/cgi-bin/listinfo 2007-05-16 19:14:10: (response.c.466) -- handling physical path 2007-05-16 19:14:10: (response.c.467) Path : /usr/local/mailman/cgi-bin/listinfo 2007-05-16 19:14:10: (response.c.474) -- file found 2007-05-16 19:14:10: (response.c.475) Path : /usr/local/mailman/cgi-bin/listinfo 2007-05-16 19:14:10: (response.c.613) -- handling subrequest 2007-05-16 19:14:10: (response.c.614) Path : /usr/local/mailman/cgi-bin/listinfo ==> /srv/4011/log/access.log <== 127.0.0.1 lists.lp.pl - [16/May/2007:19:14:10 +0200] "GET /mailman/listinfo HTTP/1.0" 200 2000 "-" "Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.1.3) Gecko/20070403 BonEcho/?2.0.0.3" }}}

11/22/2007 02:38:03 PM changed by alexxwiz@yandex.ru

FreeBSD 6.2, Lighttpd 1.4.18, bug confirmed. Please, if some one have patch for this - post it somewhere.

12/23/2007 01:18:34 AM changed by anonymous

The patch is in comments above.

01/18/2008 12:51:50 PM changed by lionel@mamane.lu

This bug may be linked to (or even be a duplicate of?) #738

01/21/2008 12:01:50 PM changed by anonymous

It's also the same as #495

02/17/2008 04:04:41 PM changed by stbuehler

  • keywords changed from mod_extforward to mod_extforward patch.

I think that should do it (it is basically the same thing as the patch from Misiolap, but uses an already existing function):

--- a/src/connections.c
+++ b/src/connections.c
@@ -834,14 +834,8 @@ int connection_reset(server *srv, connection *con) {
 		con->plugin_ctx[pd->id] = NULL;
 	}
 
-#if COND_RESULT_UNSET
-	for (i = srv->config_context->used - 1; i >= 0; i --) {
-		con->cond_cache[i].result = COND_RESULT_UNSET;
-		con->cond_cache[i].patterncount = 0;
-	}
-#else
-	memset(con->cond_cache, 0, sizeof(cond_cache_t) * srv->config_context->used);
-#endif
+	/* The cond_cache gets reset in response.c */
+//	config_cond_cache_reset(srv, con);
 
 #ifdef USE_OPENSSL
 	if (con->ssl_error_want_reuse_buffer) {
--- a/src/response.c
+++ b/src/response.c
@@ -150,6 +150,8 @@ handler_t http_response_prepare(server *srv, connection *con) {
 		 *
 		 *  */
 
+		config_cond_cache_reset(srv, con);
+
 		if (con->conf.log_condition_handling) {
 			log_error_write(srv, __FILE__, __LINE__,  "s",  "run condition");
 		}

02/26/2008 04:25:04 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [2080]


Add/Change #1164 (mod_extforward breaks (at least) URL matching)




Change Properties
Action