Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Problem Creating Socket : Permission Denied

Reply
Thread Tools

Problem Creating Socket : Permission Denied

 
 
vivekian
Guest
Posts: n/a
 
      08-20-2007
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

 
Reply With Quote
 
 
 
 
Martijn Lievaart
Guest
Posts: n/a
 
      08-22-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket Error: Permission Denied W. eWatson Python 3 02-09-2010 10:50 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Permission denied creating Singleton in GLOBAL.ASA Tony Proctor ASP General 9 10-20-2007 11:45 AM
new IO::Socket::INET + UDP/Broadcast = Permission denied ?? Why? Snail Perl Misc 0 03-09-2005 09:20 PM
Permission denied creating directory =?Utf-8?B?Q2hyaXN0b2ZmZXIgU8O4cmVuc2Vu?= ASP .Net 2 06-22-2004 07:43 AM



Advertisments