Changeset 2150

Show
Ignore:
Timestamp:
04/23/2008 01:08:13 PM (3 months ago)
Author:
stbuehler
Message:

Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lighttpd-1.4.x/NEWS

    r2149 r2150  
    1717  * Enable escaping of % and $ in redirect/rewrite; only two cases changed their behaviour: "%%" => "%", "$$" => "$" 
    1818  * Fix accesslog port (should be port from the connection, not the "server.port") (#1618) 
     19  * Fix mod_fastcgi prefix matching: match the prefix always against url, not the absolute filepath (regardless of check-local) 
    1920 
    2021- 1.4.19 - 2008-03-10 
  • branches/lighttpd-1.4.x/src/mod_fastcgi.c

    r2143 r2150  
    30783078                /* check if the next server has no load. */ 
    30793079                ndx = hctx->ext->last_used_ndx + 1; 
    3080                 if(ndx >= hctx->ext->used || ndx < 0) ndx = 0; 
     3080                if(ndx >= (int) hctx->ext->used || ndx < 0) ndx = 0; 
    30813081                host = hctx->ext->hosts[ndx]; 
    30823082                if (host->load > 0) { 
     
    34843484                        ct_len = extension->key->used - 1; 
    34853485 
    3486                         if (s_len < ct_len) continue; 
    3487  
    3488                         /* check extension in the form "/fcgi_pattern" */ 
    3489                         if (*(extension->key->ptr) == '/') { 
    3490                                 if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) 
     3486                        /* check _url_ in the form "/fcgi_pattern" */ 
     3487                        if (extension->key->ptr[0] == '/') { 
     3488                                if ((ct_len <= con->uri.path->used -1) && 
     3489                                    (strncmp(con->uri.path->ptr, extension->key->ptr, ct_len) == 0)) 
    34913490                                        break; 
    3492                         } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) { 
     3491                        } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len))) { 
    34933492                                /* check extension in the form ".fcg" */ 
    34943493                                break;