Serious Privileges Problem: Please Help

Victor Subervi victorsubervi at gmail.com
Mon Nov 9 15:46:26 EST 2009


On Mon, Nov 9, 2009 at 2:30 PM, Victor Subervi <victorsubervi at gmail.com>wrote:

>
> On Mon, Nov 9, 2009 at 2:27 PM, Rami Chowdhury <rami.chowdhury at gmail.com>wrote:
>
>> On Mon, 09 Nov 2009 11:24:33 -0800, Victor Subervi <
>> victorsubervi at gmail.com> wrote:
>>
>>  On Mon, Nov 9, 2009 at 1:53 PM, Rami Chowdhury <rami.chowdhury at gmail.com
>>> >wrote:
>>>
>>>  On Mon, 09 Nov 2009 10:36:31 -0800, Victor Subervi <
>>>> victorsubervi at gmail.com> wrote:
>>>>
>>>>  Of course. Let me start with some updates to httpd.conf, which didn't
>>>> help
>>>>
>>>>> anyway:
>>>>>
>>>>> <VirtualHost *:80>
>>>>> ServerAdmin me at creative.vi
>>>>> DocumentRoot /var/www/html/angrynates.com
>>>>> ServerName angrynates.com
>>>>> Options +ExecCGI -IncludesNoExec
>>>>> <Directory /var/www/html/angrynates.com/global_solutions>
>>>>>  Options +ExecCGI
>>>>>  AllowOverride All
>>>>>  AllowOverride FileInfo
>>>>>  #AddHandler mod_python .py
>>>>>  #PythonHandler mod_python.publisher
>>>>>  #PythonDebug On
>>>>> AddHandler cgi-script .cgi .py
>>>>> Options Includes Indexes SymLinksIfOwnerMatch ExecCGI
>>>>> <IfModule mod_security.c>
>>>>>  SecFilterEngine Off
>>>>> </IfModule>
>>>>> <IfModule mod_security2.c>
>>>>>  SecRuleEngine Off
>>>>> </IfModule>
>>>>> AddHandler cgi-script .cgi .py
>>>>> Options Includes Indexes SymLinksIfOwnerMatch ExecCGI
>>>>>
>>>>> <IfModule mod_security.c>
>>>>>  SecFilterEngine Off
>>>>> </IfModule>
>>>>> <IfModule mod_security2.c>
>>>>>  SecRuleEngine Off
>>>>> </IfModule>
>>>>>
>>>>> </Directory>
>>>>> </VirtualHost>
>>>>>
>>>>> Here's index.py:
>>>>>
>>>>> #!/usr/bin/python
>>>>>
>>>>> import string
>>>>> import cgitb; cgitb.enable()
>>>>> import cgi
>>>>> import sys,os
>>>>> sys.path.append(os.getcwd())
>>>>> from template import template
>>>>>
>>>>> ourFile = string.split(__file__, "/")
>>>>> page = ourFile[len(ourFile) - 1][:-3]
>>>>>
>>>>> form = cgi.FieldStorage()
>>>>> w = form.getfirst('w', '1024')
>>>>>
>>>>> template(page, w)
>>>>>
>>>>>
>>>>>
>>>>>  Can you try running index.py from the command-line, and let me know if
>>>> that
>>>> works?
>>>>
>>>>
>>> It runs fine. So I created a test file of the same, chmod and tried it on
>>> my
>>> browser. Rendered. So I deleted index.py and recreated it from the
>>> command
>>> line, chmod. Rendered! Apparently, somehow in the translation from
>>> uploading
>>> it via ftp to moving the files to a new dir, something got screwed up in
>>> the
>>> permissions that I can't see! Any idea what the heck that could possibly
>>> be??
>>> TIA,
>>> V
>>>
>>
>> What platform did you upload from? Something as seemingly insignificant as
>> Windows line-endings can mess up file execution...
>>
>
> OS is Windoze XL. Have we caught the thief? How can I upload from this box
> and not have this problem, or undo it at the server? You know, of course, I
> don't see this line-ending from the command prompt when I vi it.
> TIA,
> V
>
> Hold everything. Apparently line-endings got mangled. What I don't
understand is why I didn't see them when I opened the file to edit, and why
they didn't copy and paste when I did that. But dos2unix cleaned up a couple
of files so I presume it will clean up the rest. However, I tried one file,
that reads exactly the same as index.py, and when I surfed to it got a 500
error. Here's what the log said:

[Mon Nov 09 12:30:27 2009] [notice] mod_python: (Re)importing module
'mptest'
[Mon Nov 09 12:30:27 2009] [error] [client 98.189.137.242] PythonHandler
mptest: Traceback (most recent call last):, referer:
http://www.angrynates.com/global_solutions/
[Mon Nov 09 12:30:27 2009] [error] [client 98.189.137.242] PythonHandler
mptest:   File "/usr/lib64/python2.4/site-packages/mod_python/apache.py",
line 287, in HandlerDispatch\n    log=debug), referer:
http://www.angrynates.com/global_solutions/
[Mon Nov 09 12:30:27 2009] [error] [client 98.189.137.242] PythonHandler
mptest:   File "/usr/lib64/python2.4/site-packages/mod_python/apache.py",
line 461, in import_module\n    f, p, d = imp.find_module(parts[i], path),
referer: http://www.angrynates.com/global_solutions/
[Mon Nov 09 12:30:27 2009] [error] [client 98.189.137.242] PythonHandler
mptest: ImportError: No module named mptest, referer:
http://www.angrynates.com/global_solutions/

Huh? Got no "mptest" anywhere. Not even using mod_python. Why doesn't it
refer to a specific file in the folder? Any ideas on this one?
TIA,
V

>
>>
>>
>> --
>> Rami Chowdhury
>> "Never attribute to malice that which can be attributed to stupidity" --
>> Hanlon's Razor
>> 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091109/cf262d4e/attachment-0001.html>


More information about the Python-list mailing list