[mod_python] mod_python.publisher - path traversal fails

John Black JohnBlack at kashori.com
Wed Aug 24 22:08:55 EDT 2005


I am working on a python application on a Red Hat Linux server running
Apache 2.0.48 with Python 2.2.3 and mod_python 3.1.4

I must not have something configured correctly and it seems to me that 
causes mod_python.publisher fails. If I do this:

http://domain.com/mytest.py

when I have configured:

<Directory /home/webadmin/domain.com/html>
    AddHandler mod_python .py
    PythonHandler mytest
    PythonDebug On
</Directory>

Then the default 'def handler(req):' works and prints "Hello World".


But if I try to do this:

http://domain.com/mytest.py

when I have configured:

<Directory /home/webadmin/domain.com/html>
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
</Directory>

Then I get a 404 error from Apache or a zero-byte return.


However, if I call this http://domain.com/mytes.py (deforming mytest to mytes) 
then I get this:
Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/usr/lib/python2.2/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.2/site-packages/mod_python/publisher.py", line 98, in handler
    path=[path])

  File "/usr/lib/python2.2/site-packages/mod_python/apache.py", line 454, in import_module
    f, p, d = imp.find_module(parts[i], path)

ImportError: No module named mytesCheers,
John Black
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050824/d2dfd951/attachment.html


More information about the Mod_python mailing list