ASF Bugzilla – Attachment 37183 Details for
Bug 64365
ProxyFCGISetEnvIf does not evaluate condition when unsetting variables.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch that appears to fix the problem for me
ProxyFCGISetEnvIf conditional unset.patch (text/plain), 2.31 KB, created by
Michael König
on 2020-04-18 09:10:38 UTC
(
hide
)
Description:
A patch that appears to fix the problem for me
Filename:
MIME Type:
Creator:
Michael König
Created:
2020-04-18 09:10:38 UTC
Size:
2.31 KB
patch
obsolete
>--- modules/proxy/mod_proxy_fcgi.c.orig >+++ modules/proxy/mod_proxy_fcgi.c >@@ -165,49 +165,51 @@ > ProxyFCGISetEnvIf "reqenv('PATH_TRANSLATED') =~ m#(/.*foo)(\d+)(.*)#" PATH_TRANSLATED "$1$3" > */ > static void fix_cgivars(request_rec *r, fcgi_dirconf_t *dconf) > { > sei_entry *entries; > const char *err, *src; > int i = 0, rc = 0; > ap_regmatch_t regm[AP_MAX_REG_MATCH]; > > entries = (sei_entry *) dconf->env_fixups->elts; > for (i = 0; i < dconf->env_fixups->nelts; i++) { > sei_entry *entry = &entries[i]; > >+ if (0 >= (rc = ap_expr_exec_re(r, entry->cond, AP_MAX_REG_MATCH, regm, &src, &err))) { >+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r, "fix_cgivars: Condition returned %d", rc); >+ continue; >+ } >+ > if (entry->envname[0] == '!') { > apr_table_unset(r->subprocess_env, entry->envname+1); > } >- else if (0 < (rc = ap_expr_exec_re(r, entry->cond, AP_MAX_REG_MATCH, regm, &src, &err))) { >+ else { > const char *val = ap_expr_str_exec_re(r, entry->subst, AP_MAX_REG_MATCH, regm, &src, &err); > if (err) { > ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03514) > "Error evaluating expression for replacement of %s: '%s'", > entry->envname, err); > continue; > } > if (APLOGrtrace4(r)) { > const char *oldval = apr_table_get(r->subprocess_env, entry->envname); > ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r, > "fix_cgivars: override %s from '%s' to '%s'", > entry->envname, oldval, val); > > } > apr_table_setn(r->subprocess_env, entry->envname, val); > } >- else { >- ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r, "fix_cgivars: Condition returned %d", rc); >- } > } > } > > /* Wrapper for apr_socket_sendv that handles updating the worker stats. */ > static apr_status_t send_data(proxy_conn_rec *conn, > struct iovec *vec, > int nvec, > apr_size_t *len) > { > apr_status_t rv = APR_SUCCESS; > apr_size_t written = 0, to_write = 0; > int i, offset; > apr_socket_t *s = conn->sock;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 64365
: 37183