Apache CGI Scripts - Network layer permission denied

Peter Flanigan Peter.Flanigan@RoxSoft.co.uk
Fri Aug 13 16:42:00 GMT 2004


When I run CGI scripts from Apache I'm getting permission denied errors.

use Net::protoent;
my $p = getprotobyname(shift || 'tcp');

if (defined $p) {
 printf("proto for %s is %d, aliases are %s\n",
          $p->name, $p->proto, "@{$p->aliases}");
} else {
 printf("Bad protocol 'tcp'\n");
}

This correctly turns ths string 'tcp' into the number 6 via lookup in
/etc/protocols when run from the pdksh prompt. Returns the bad protocol
error when run as a CGI script from Apache. Apache is being started (by
apachectl start) from the same shell prompt which correctly runs the script.
In general I'm finding that all network related calls (creating new sockets
and similar) are failing.

I also note (and think that it's related) that uname -n returns the correct
mixed case hostname when run from the shell prompt but returns an incorrect
(all upper case) string when run from the cgi-bin/test-cgi shell script.
This eliminates Perl from the equation.

I think this is the same problem as posted to this mailing list by:

Richard Morse <remorse@partners.org>
Problems with Amanda and Cygwin 1.5.10
28/07/2004

and

"David A. Rogers" darogers@speakeasy.net
Socket problem w/ apache & perl cgi
30/07/2004

I did not notice any follow up posts to these queries (my spam filter was
rejecting some Cygwin mailing list posts).

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 25368 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040813/456ce94c/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list