~ubuntu-branches/ubuntu/hardy/lighttpd/hardy

« back to all changes in this revision

Viewing changes to src/response.c

  • Committer: Bazaar Package Importer
  • Author(s): Jeremie Corbier
  • Date: 2006-09-22 19:16:08 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060922191608-i9jngvf1wtf3j5rd
Tags: 1.4.12~20060907-1ubuntu1
Merge from debian unstable:
-> Keep the additional dependency on libterm-readline-perl-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
                 */
262
262
                
263
263
                config_patch_connection(srv, con, COMP_HTTP_URL); /* HTTPurl */
264
 
                
 
264
                config_patch_connection(srv, con, COMP_HTTP_QUERYSTRING); /* HTTPqs */
 
265
 
 
266
                /* do we have to downgrade to 1.0 ? */
 
267
                if (!con->conf.allow_http11) {
 
268
                        con->request.http_version = HTTP_VERSION_1_0;
 
269
                }
 
270
 
265
271
                switch(r = plugins_call_handle_uri_clean(srv, con)) {
266
272
                case HANDLER_GO_ON:
267
273
                        break;
451
457
                        log_error_write(srv, __FILE__, __LINE__,  "s",  "-- handling physical path");
452
458
                        log_error_write(srv, __FILE__, __LINE__,  "sb", "Path         :", con->physical.path);
453
459
                }
454
 
                
 
460
 
455
461
                if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
456
462
                        /* file exists */
457
463
                        
459
465
                                log_error_write(srv, __FILE__, __LINE__,  "s",  "-- file found");
460
466
                                log_error_write(srv, __FILE__, __LINE__,  "sb", "Path         :", con->physical.path);
461
467
                        }
462
 
                        
 
468
#ifdef HAVE_LSTAT
 
469
                        if ((sce->is_symlink != 0) && !con->conf.follow_symlink) {
 
470
                                con->http_status = 403;
 
471
 
 
472
                                if (con->conf.log_request_handling) {
 
473
                                        log_error_write(srv, __FILE__, __LINE__,  "s",  "-- access denied due symlink restriction");
 
474
                                        log_error_write(srv, __FILE__, __LINE__,  "sb", "Path         :", con->physical.path);
 
475
                                }
 
476
 
 
477
                                buffer_reset(con->physical.path);
 
478
                                return HANDLER_FINISHED;
 
479
                        };
 
480
#endif
463
481
                        if (S_ISDIR(sce->st.st_mode)) {
464
482
                                if (con->physical.path->ptr[con->physical.path->used - 2] != '/') {
465
483
                                        /* redirect to .../ */
468
486
                                        
469
487
                                        return HANDLER_FINISHED;
470
488
                                }
 
489
#ifdef HAVE_LSTAT
 
490
                        } else if (!S_ISREG(sce->st.st_mode) && !sce->is_symlink) {
 
491
#else
471
492
                        } else if (!S_ISREG(sce->st.st_mode)) {
 
493
#endif
472
494
                                /* any special handling of non-reg files ?*/
473
495
 
474
496