From: Steve Hay Date: Mon, 6 Sep 2004 10:16:12 +0000 (+0000) Subject: Implement new environment variable to allow the use of non-IFS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c97260979b979af03b946d71d50e8e4c075665c;p=p5sagit%2Fp5-mst-13.2.git Implement new environment variable to allow the use of non-IFS compatible LSP's on Windows to allow Perl to work in conjunction with a firewall such as McAfee Guardian. Bug report and possible solutions by Ken Fox ; further assistance by Artiom Morozov . p4raw-id: //depot/perl@23275 --- diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 3feab02..3238a5c 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -1111,6 +1111,20 @@ fit for interactive use, and setting COMSPEC to such a shell may interfere with the proper functioning of other programs (which usually look in COMSPEC to find a shell fit for interactive use). +=item PERL_ALLOW_NON_IFS_LSP (specific to the Win32 port) + +Set to 1 to allow the use of non-IFS compatible LSP's. +Perl normally searches for an IFS-compatible LSP because this is required +for its emulation of Windows sockets as real filehandles. However, this may +cause problems if you have a firewall such as McAfee Guardian which requires +all applications to use its LSP which is not IFS-compatible, because clearly +Perl will normally avoid using such an LSP. +Setting this environment variable to 1 means that Perl will simply use the +first suitable LSP enumerated in the catalog, which keeps McAfee Guardian +happy (and in that particular case Perl still works too because McAfee +Guardian's LSP actually plays some other games which allow applications +requiring IFS compatibility to work). + =item PERL_DEBUG_MSTATS Relevant only if perl is compiled with the malloc included with the perl diff --git a/win32/win32sck.c b/win32/win32sck.c index 0e2be30..58b13e0 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -398,10 +398,15 @@ convert_proto_info_w2a(WSAPROTOCOL_INFOW *in, WSAPROTOCOL_INFOA *out) SOCKET open_ifs_socket(int af, int type, int protocol) { + dTHX; + char *s; unsigned long proto_buffers_len = 0; int error_code; SOCKET out = INVALID_SOCKET; + if ((s = PerlEnv_getenv("PERL_ALLOW_NON_IFS_LSP")) && atoi(s)) + return WSASocket(af, type, protocol, NULL, 0, 0); + if (WSCEnumProtocols(NULL, NULL, &proto_buffers_len, &error_code) == SOCKET_ERROR && error_code == WSAENOBUFS) {