You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Frank Faubert <fr...@sane.com> on 1997/11/11 21:13:48 UTC

os-windows/1395: FIX for PR numbers #939,951,1131 (WinSock Errors in CGI programs)

>Number:         1395
>Category:       os-windows
>Synopsis:       FIX for PR numbers #939,951,1131 (WinSock Errors in CGI programs)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Nov 11 12:20:00 PST 1997
>Last-Modified:
>Originator:     frank@sane.com
>Organization:
apache
>Release:        1.3b2
>Environment:
NT 4.0, Win 95, Microsoft Visual C++ 5.0
>Description:
PR #'s 939, 951, and 1131 are all related to the fact that CGI applications
cannot use Windows Sockets.  Apparently (and I have not seen this documented
anywhere... Go Microsoft) you have to set the SystemRoot, COMSPEC, and WINDIR 
environment variables for Windows Sockets to work correctly.  The patch below
adds these in util_script.c.
>How-To-Repeat:
See PR #'s 939, 951, and 1131
>Fix:
*** util_script.c.orig	Mon Nov 10 22:51:27 1997
--- util_script.c	Tue Nov 11 13:44:55 1997
***************
*** 163,168 ****
--- 163,171 ----
      const char *rem_logname;
  
      char port[40], *env_path;
+ #ifdef WIN32
+     char *env_temp;
+ #endif
  
      array_header *hdrs_arr = table_elts(r->headers_in);
      table_entry *hdrs = (table_entry *) hdrs_arr->elts;
***************
*** 197,202 ****
--- 200,214 ----
      if (!(env_path = getenv("PATH")))
  	env_path = DEFAULT_PATH;
  
+ #ifdef WIN32
+     if (env_temp = getenv("SystemRoot"))
+         table_set(e, "SystemRoot", env_temp);        	
+     if (env_temp = getenv("COMSPEC"))
+         table_set(e, "COMSPEC", env_temp);        	
+     if (env_temp = getenv("WINDIR"))
+         table_set(e, "WINDIR", env_temp);        	
+ #endif
+ 
      table_set(e, "PATH", env_path);
      table_set(e, "SERVER_SOFTWARE", SERVER_VERSION);
      table_set(e, "SERVER_NAME", s->server_hostname)%3
>Audit-Trail:
>Unformatted: