"su -" in CGI script ?

R

Robert Nilsson

Hello

I'm trying to execute a specific command from a CGI script written in PERL.
I have to be a special user so I've tried to use "su -" but it doesn't work.
The CGI script is running as the user apache on the server, right? Is that
the problem? Is there any other way to execute something with "system" as
someone else within perl?


Robert
 
R

Robert Nilsson

for example:

system "su - surf -c /home/surf/bin/vnc start SV_STALOVN";



/ Robert
 
G

Gregory Toomey

Robert said:
Hello

I'm trying to execute a specific command from a CGI script written in
PERL. I have to be a special user so I've tried to use "su -" but it
doesn't work. The CGI script is running as the user apache on the server,
right?
We dont know, you're telling the story.
Is that the problem? Is there any other way to execute something
with "system" as someone else within perl?


Robert

Try a setuid wrapper, to run as the user you want.
http://httpd.apache.org/docs/suexec.html

gtoomey
 
C

chris-usenet

Robert Nilsson said:
I'm trying to execute a specific command from a CGI script written in PERL.
I have to be a special user so I've tried to use "su -" but it doesn't work.
The CGI script is running as the user apache on the server, right? Is that
the problem? Is there any other way to execute something with "system" as
someone else within perl?

This is an OS question (UNIX) not a perl one. "su" requires a password. If
you're running a CGI script there's no terminal from which it can get
the password. Read "man su" for details.

I don't understand what you mean by << executing something with "system" >>,
though.

Chris
 
R

Robert Nilsson

This is an OS question (UNIX) not a perl one. "su" requires a password. If
you're running a CGI script there's no terminal from which it can get
the password. Read "man su" for details.

I don't understand what you mean by << executing something with "system"
though.

Chris

..... the command "system" in PERL
 
C

chris-usenet

I don't understand what you mean by << executing something with "system"
Robert Nilsson said:
.... the command "system" in PERL

Doh; I was still thinking in UNIX terms. Glad to see you've got a solution
from another poster, though

Chris
 

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
474,161
Messages
2,570,891
Members
47,423
Latest member
henerygril

Latest Threads

Top