ASF Bugzilla – Attachment 35291 Details for
Bug 61189
CGIServlet should be able to set specific environment variables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow to configure CGI specific environment variables.
CGIServlet.java.AdditionalEnvironmentVariables.patch (text/plain), 1.53 KB, created by
jm009
on 2017-09-05 08:01:57 UTC
(
hide
)
Description:
Allow to configure CGI specific environment variables.
Filename:
MIME Type:
Creator:
jm009
Created:
2017-09-05 08:01:57 UTC
Size:
1.53 KB
patch
obsolete
>Index: java/org/apache/catalina/servlets/CGIServlet.java >=================================================================== >--- java/org/apache/catalina/servlets/CGIServlet.java (revision 1807314) >+++ java/org/apache/catalina/servlets/CGIServlet.java (working copy) >@@ -311,6 +311,30 @@ > shellEnv.putAll(System.getenv()); > } > >+ if (config.getInitParameter("environment-variable-1") != null) { >+ for (int i = 1;; i++) { >+ String envVar = config.getInitParameter("environment-variable-" + i); >+ if (envVar == null) { >+ break; >+ } >+ if (envVar.length() == 0) { >+ throw new ServletException("Invalid empty environment-variable-" + i + "."); >+ } >+ int equalIndex = envVar.indexOf('='); >+ if (equalIndex == 0) { >+ throw new ServletException("Empty name in environment-variable-" + i + "."); >+ } >+ else if (equalIndex < 0) { >+ shellEnv.put(envVar, ""); >+ } >+ else { >+ String variableName = envVar.substring(0, equalIndex); >+ String variableValue = envVar.substring(equalIndex + 1); >+ shellEnv.put(variableName, variableValue); >+ } >+ } >+ } >+ > if (getServletConfig().getInitParameter("executable") != null) { > cgiExecutable = getServletConfig().getInitParameter("executable"); > }
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 61189
: 35291 |
35296
|
35297