[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sheflug] executing a program as a certain user from a CGI/perl script
OK here's my query
We have a mixed linux/windows LAN in out flat with a Linux intenet
ip-masq gateway/mailserver/caching DNS. In the past if a user wanted to
connect the LAN to the internet they would telnet into the gateway and
run pppd which is suid root. Now I have written a perl cgi script so now
all the user has to do is point their browser at the server & click on
the connect or disconnect buttons on the gateway's webpage. This is fine
except it also allows random internet users outside our LAN to
disconnect us from the internet also - what I want is a
username/password login on the webpage (easy with a POST type <form>)
but how do I run pppd from the perl script with the supplied username &
password? I tried....
open(shell, "| su $username -c pppd call $connection");
print(shell $password);
[$username, $password & $connection come from POST data from webpage]
..but 'su' won't work down a pipe. This is stretching the limits of my
(very basic) perl so I'm lost.
any ideas apprectated.
A. Basterfield
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.