[mod_python] mod_python.publisher - path traversal fails

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


Ok. Actually I was just trying to keep it simple. I 
realize that mod_python.publisher has a different 
way of handling calls than is used with def handler(req)
By the way, I have this code working on two other systems at 
home. The whole thing works perfectly. On my home system, 
when I use mod_python.publisher it is with a call like 

    http://domain.com/mytest.py/paramsTest

However, on the production server mentioned below, this 
does not work either. I still get the 404 error.

Cheers,
John
  Sent: Wednesday, August 24, 2005 10:08 PM


  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



------------------------------------------------------------------------------


  _______________________________________________
  Mod_python mailing list
  Mod_python at modpython.org
  http://mailman.modpython.org/mailman/listinfo/mod_python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050824/d44cd63e/attachment.html


More information about the Mod_python mailing list