Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126522 - mod_suphp excecutes everything that has ".php" in filename
Summary: mod_suphp excecutes everything that has ".php" in filename
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-17 05:25 UTC by Christian Bricart
Modified: 2006-03-20 21:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Bricart 2006-03-17 05:25:07 UTC
applies to:
  www-apache/mod_suphp-0.6.1-r1 +mode-owner
additional:
  net-www/apache-2.0.55-r1
  dev-lang/php-5.1.2
  dev-lang/php-4.4.1-r3

It seem that the directive:
  AddHandler x-httpd-php   .php
in /etc/apache2/modules.d/70_mod_suphp.conf adds a Handler for *.php* rather than *.php$ as e.g. a file
  /var/www/localhost/htdocs/this.is.no.php.file.pdf
get's executed by mod_suphp. This certainly results in broken output (error message with "could not parse" to browser). It's also loged in /var/log/apache2/suphp_log that the file has been executed as the owner...

Is this a bug in mod_suphp? or perhaps in Apache's "AddHandler"?
Comment 1 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-03-20 21:11:04 UTC
This is not a bug, but how it's intended to work:


http://httpd.apache.org/docs/2.0/mod/mod_mime.html

Files with Multiple Extensions

Files can have more than one extension, and the order of the extensions is normally irrelevant. For example, if the file welcome.html.fr maps onto content type text/html and language French then the file welcome.fr.html will map onto exactly the same information. If more than one extension is given which maps onto the same type of meta-information, then the one to the right will be used, except for languages and content encodings. For example, if .gif maps to the MIME-type image/gif and .html maps to the MIME-type text/html, then the file welcome.gif.html will be associated with the MIME-type text/html.

Languages and content encodings are treated accumulative, because one can assign more than one language or encoding to a particular resource. For example, the file welcome.html.en.de will be delivered with Content-Language: en, de and Content-Type: text/html.

Care should be taken when a file with multiple extensions gets associated with both a MIME-type and a handler. This will usually result in the request being by the module associated with the handler. For example, if the .imap extension is mapped to the handler imap-file (from mod_imap) and the .html extension is mapped to the MIME-type text/html, then the file world.imap.html will be associated with both the imap-file handler and text/html MIME-type. When it is processed, the imap-file handler will be used, and so it will be treated as a mod_imap imagemap file.