On Fri, Jul 23, 1999, [EMAIL PROTECTED] wrote:

> Full_Name: Caitlin Howell
> Version: 2.3.5
> OS: Windows Workstation 4.0
> Submission from: proxy3.fm.intel.com (132.233.247.6)
> 
> I compiled Apache for Win32 with OpenSSL and mod_ssl, according to the
> directions available on the respective web sites.  Everything works great,
> except for the SSLRandomSeed exec directive.  I would like to use SSLRandomSeed
> exec with an program that generates random bytes.  
> 
> SSLRandomSeed builtin and file work, but exec doesn't.  I suspect this has to do
> with a difference in process handling between Linux and Win32.  As far as I can
> tell, the web server won't launch the process to generate random bytes.  
> 
> I realize Win32 is low priority, but maybe one of the Apache -> Win32 porters
> would know whether or not this is a process launching problem that could be
> cleared up easily.

Hmmm... yes, brain-dead Win32 needs special exec() stuff.  I've copied over
the stuff from mod_rewrite.c to ssl_util.c.  A patch is appended. Please try
it out and give feedback.

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

Index: ssl_util.c
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/modules/ssl/ssl_util.c,v
retrieving revision 1.21
diff -u -r1.21 ssl_util.c
--- ssl_util.c  1999/05/20 10:40:21     1.21
+++ ssl_util.c  1999/07/23 06:49:45
@@ -202,13 +202,48 @@
 {
     int child_pid = 1;
 
+    /*
+     * Prepare for exec
+     */
     ap_cleanup_for_exec();
 #ifdef SIGHUP
     signal(SIGHUP, SIG_IGN);
 #endif
-#if defined(__EMX__)
+
+    /*
+     * Exec() the child program
+     */
+#if defined(WIN32)
+    /* MS Windows */
+    {
+        char pCommand[MAX_STRING_LEN];
+        STARTUPINFO si;
+        PROCESS_INFORMATION pi;
+
+        ap_snprintf(pCommand, sizeof(pCommand), "%s /C %s", SHELL_PATH, cmd);
+
+        memset(&si, 0, sizeof(si));
+        memset(&pi, 0, sizeof(pi));
+
+        si.cb          = sizeof(si);
+        si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
+        si.wShowWindow = SW_HIDE;
+        si.hStdInput   = pinfo->hPipeInputRead;
+        si.hStdOutput  = pinfo->hPipeOutputWrite;
+        si.hStdError   = pinfo->hPipeErrorWrite;
+
+        if (CreateProcess(NULL, pCommand, NULL, NULL, TRUE, 0,
+                          environ, NULL, &si, &pi)) {
+            CloseHandle(pi.hProcess);
+            CloseHandle(pi.hThread);
+            child_pid = pi.dwProcessId;
+        }
+    }
+#elif defined(OS2)
+    /* IBM OS/2 */
     execl(SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
 #else
+    /* Standard Unix */
     execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL);
 #endif
     return (child_pid);

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to