Python cgi Apache os.system()

N

naima.mans

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
 
D

Dennis Lee Bieber

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
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
C

Cameron Walsh

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.
 
N

naima.mans

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top