www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian G. Reid" <br...@customlogic.com>
Subject suExec patch for mod_ssl environment variables
Date Mon, 17 Dec 2001 18:19:43 GMT
Hello,

I am trying to use suExec for running CGI programs on a server that
is secured using mod_ssl.  The problem that I am running into is that
suExec strips out all of the SSL related environment variables when it
cleans the environment space of the child process.  Since it strips out
the variables, I lose the ability to detect whether my CGI programs are
running through SSL.

I have attached a patch to suexec.c that adds the HTTPS variable to the 
"safe_env_lst" variable and adds a check in clean_env() to look for and 
retain all the variables that start with "SSL_".

Thanks,
Brian Reid
breid@customlogic.com

PATCH FOLLOWS:

diff -urN oldhttpd/support/suexec.c httpd-2_0_28/support/suexec.c
--- oldhttpd/support/suexec.c	Tue Oct 30 09:38:03 2001
+++ httpd-2_0_28/support/suexec.c	Mon Dec 17 10:08:51 2001
@@ -136,6 +136,7 @@
     "DOCUMENT_URI",
     "FILEPATH_INFO",
     "GATEWAY_INTERFACE",
+    "HTTPS",
     "LAST_MODIFIED",
     "PATH_INFO",
     "PATH_TRANSLATED",
@@ -227,7 +228,7 @@
     cidx++;
 
     for (ep = environ; *ep && cidx < AP_ENVBUF-1; ep++) {
-	if (!strncmp(*ep, "HTTP_", 5)) {
+	if (!strncmp(*ep, "HTTP_", 5) || !strncmp(*ep, "SSL_",4)) {
 	    cleanenv[cidx] = *ep;
 	    cidx++;
 	}



Mime
View raw message