Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Problem Creating Socket : Permission Denied (http://www.velocityreviews.com/forums/t904292-problem-creating-socket-permission-denied.html)

vivekian 08-20-2007 03:23 PM

Problem Creating Socket : Permission Denied
 
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


Martijn Lievaart 08-22-2007 08:04 PM

Re: Problem Creating Socket : Permission Denied
 
On Mon, 20 Aug 2007 15:23:27 +0000, vivekian wrote:

> 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


All times are GMT. The time now is 05:04 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


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