To workaround this, I modded a fcgid_add_cgi_vars function in
mod_fcgid.c, i am using this for years:

static void fcgid_add_cgi_vars(request_rec * r)
{
      char *authinfo, *decoded_line, *user, *pass;
      int l;

        apr_array_header_t *passheaders = get_pass_headers(r);

        if (passheaders != NULL) {
                const char **hdr = (const char **) passheaders->elts;
                int hdrcnt = passheaders->nelts;
                int i;

                for (i = 0; i < hdrcnt; i++, ++hdr) {
                        const char *val = apr_table_get(r->headers_in, *hdr);

                        if (val)
                                apr_table_setn(r->subprocess_env, *hdr, val);
                }
        }

        /* Work around cgi.fix_pathinfo = 1 in php.ini */
        if (g_php_fix_pathinfo_enable) {
                char *merge_path;
                apr_table_t *e = r->subprocess_env;

                /* "DOCUMENT_ROOT"/"SCRIPT_NAME" -> "SCRIPT_NAME" */
                const char *doc_root = apr_table_get(e, "DOCUMENT_ROOT");
                const char *script_name = apr_table_get(e, "SCRIPT_NAME");

                if (doc_root && script_name
                        && apr_filepath_merge(&merge_path, doc_root, 
script_name, 0,
                                                                  r->pool) == 
APR_SUCCESS) {
                        apr_table_setn(e, "SCRIPT_NAME", merge_path);
                }
        }

    authinfo = apr_table_get(r->headers_in, "Authorization");
    if (authinfo && authinfo[0] != '\0' && strncmp(authinfo, "Basic ", 6) == 0)
    {
      decoded_line = apr_palloc(r->pool, apr_base64_decode_len(authinfo + 6) + 
1);
      if(decoded_line != NULL) {
        l = apr_base64_decode(decoded_line, authinfo+6);
        /* Null-terminate the string. */
        decoded_line[l] = '\0';

        user = decoded_line;
        if (user && (pass = strchr(user, ':')))
        {
          apr_table_t *e = r->subprocess_env;
          *pass++ = '\0';
          apr_table_setn(e, "PHP_AUTH_USER", user);
          apr_table_setn(e, "PHP_AUTH_PW", pass);
        }
      }
   }

}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users

Reply via email to