durusmail: quixote-users: Patch for mod_scgi to pass on REMOTE_USER
Patch for mod_scgi to pass on REMOTE_USER
2002-09-02
Patch for mod_scgi to pass on REMOTE_USER
Hamish Lawson
2002-09-02
mod_scgi doesn't seem to pass the REMOTE_USER variable on to the SCGI
server. Here is a patch to fix that. I've increased the size parameter
passed to ap_make_table from 20 to 22, as it looks like it was originally
one short than the number of headers that could potentially be passed.

Hamish Lawson



 > diff -c mod_scgi.c /usr/local/src/scgi-0.4/mod_scgi.c
*** mod_scgi.c  Wed Jul 31 17:09:49 2002
--- /usr/local/src/scgi-0.4/mod_scgi.c  Tue Aug 20 16:40:13 2002
***************
*** 185,191 ****

   static int send_headers(request_rec *r, BUFF *f, scgi_cfg *cfg)
   {
!       table *t = ap_make_table(r->pool, 20); /* headers to send */
         array_header *hdrs_arr;
         table_entry *hdrs;
         int i;
--- 185,191 ----

   static int send_headers(request_rec *r, BUFF *f, scgi_cfg *cfg)
   {
!       table *t = ap_make_table(r->pool, 22); /* headers to send */
         array_header *hdrs_arr;
         table_entry *hdrs;
         int i;
***************
*** 204,209 ****
--- 204,210 ----
         add_header(t, "SERVER_PORT",
                         ap_psprintf(r->pool, "%u", ap_get_server_port(r)));
         add_header(t, "REMOTE_ADDR", r->connection->remote_ip);
+       add_header(t, "REMOTE_USER", r->connection->user);
         add_header(t, "REMOTE_PORT",
                         ap_psprintf(r->pool, "%d",
                                 ntohs(r->connection->remote_addr.sin_port)));



reply