Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python cgi Apache os.system()

Reply
Thread Tools

Python cgi Apache os.system()

 
 
naima.mans@gmail.com
Guest
Posts: n/a
 
      11-08-2006
Hello

I have installed Apache on windows...
The server work well, and my python script also

but when I want in my python script to run a System command like
os.system(my_command) the script doesn't do anything!

here the error.log

[Wed Nov 08 14:19:30 2006] [error] [client 127.0.0.1] The system cannot
find the drive specified.\r, referer:
http://127.0.0.1/cgi-bin/extract_source.py

When i run the python script manually it works!

i think it's a user access probleme but i don't know how to resolve it
!

please help ....
thanks

 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      11-09-2006
On 8 Nov 2006 05:25:02 -0800, declaimed the
following in comp.lang.python:

> Hello
>
> I have installed Apache on windows...
> The server work well, and my python script also
>
> but when I want in my python script to run a System command like
> os.system(my_command) the script doesn't do anything!
>

And just what is the current value of "my_command" at this point?

>
> i think it's a user access probleme but i don't know how to resolve it
> !
>

A secure webserver should have arranged a "cell" around itself, so
that it can not access any old file on the host machine; typically only
directories that are subordinate to the server "root" are accessible.

On a really secure server, even the allowed command binaries need to
be in a subordinate to the server root -- it isn't allowed to even
access things that are in normal executable paths...
--
Wulfraed Dennis Lee Bieber KD6MOG

HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-)
HTTP://www.bestiaria.com/
 
Reply With Quote
 
 
 
 
Cameron Walsh
Guest
Posts: n/a
 
      11-09-2006
wrote:
> Hello
>
> I have installed Apache on windows...
> The server work well, and my python script also
>
> but when I want in my python script to run a System command like
> os.system(my_command) the script doesn't do anything!
>
> here the error.log
>
> [Wed Nov 08 14:19:30 2006] [error] [client 127.0.0.1] The system cannot
> find the drive specified.\r, referer:
> http://127.0.0.1/cgi-bin/extract_source.py
>
> When i run the python script manually it works!
>
> i think it's a user access probleme but i don't know how to resolve it
> !
>
> please help ....
> thanks
>


Without knowing what "my_command" is, all I can suggest is that
"my_command" might be referring to a file that is in your user path, but
not in the path of the user used to run apache or python (which could be
"nobody").

Depending on how securely your server is configured, you may be able to
access whichever file it is looking for if you specify the full path to
the file, or the relative path from the server root directory (watch out
for hardlinks/softlinks.)

Cameron.
 
Reply With Quote
 
naima.mans@gmail.com
Guest
Posts: n/a
 
      11-09-2006
Hello

thanks for your help..

it was a problem of path as you mentionned... my command was "O:\\....
ccm start" and i have change it with the path of the drive O

thanks a lot
have a good day

Tachi

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache cgi and multiple versions of python Lars Wessman Python 0 08-12-2007 11:52 PM
File Creation Problem with CGI Scripts in Apache cgi-bin (Fedora Core 3) BestFriend Perl Misc 2 08-21-2006 04:02 PM
Python-cgi or Perl-cgi script doubt praba kar Python 1 07-30-2005 08:25 AM
Running python cgi scripts that require external cvs under apache chris.levis@gmail.com Python 1 05-06-2005 08:50 PM
Python CGI - Accepting Input, Invoking Another Process, Ending CGI LarsenMTL Python 4 11-04-2004 05:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57