Problem Creating Socket : Permission Denied

V

vivekian

Hi,

I have a cgi script which opens a telnet session to a switch. The
script is listed below. It executes fine on command line. When i call
it via a web browser, the error log shows the following error :

problem creating socket: Permission denied at /var/www/html/vlab/cgi-
bin/init_lab.cgi line 10

Other scripts which don't have sockets execute fine.

The file permissions for init_lab.cgi are :

-rwxrwxrwx 1 apache tspradhan 634 2007-08-20 00:48 init_lab.cgi

Not sure what is being missed here.

#!/usr/bin/perl

use CGI ;
use Net::Telnet ();
my $passwd = "network" ;
$t = new Net::Telnet (Timeout => 2);
$t->open("192.168.1.1");
$t -> waitfor ('/Enter password: /');
$t -> print ('network') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('V') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('C') ;
$t -> waitfor ('/Select \[1 \- 4\]: /') ;
$t -> print ('1') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('M') ;
$t -> waitfor ('/Enter port numbers: /') ;
$t -> print ('1-16') ;
$t -> close ;
exit(0);

Thanks in advance,
vivekian
 
M

Martijn Lievaart

Hi,

I have a cgi script which opens a telnet session to a switch. The script
is listed below. It executes fine on command line. When i call it via a
web browser, the error log shows the following error :

problem creating socket: Permission denied at /var/www/html/vlab/cgi-
bin/init_lab.cgi line 10

Other scripts which don't have sockets execute fine.

Just a guess, but could it be selinux that gets in the way?

M4
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top