From: William A. Rowe Jr Date: Thu, 23 Sep 2010 19:50:14 +0000 (+0000) Subject: Because PATH and the library path are closely interrelated, and the cause X-Git-Tag: 2.3.9~440 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c3b1e2ec5c75a769938be82b121c68de3f686b5;p=apache Because PATH and the library path are closely interrelated, and the cause of most confusion over cgi or fcgid failures, or even starting rotatelogs, etc, when the server binaries have been relocated, pass the library path as paired with the system PATH. Of course, PATH and platform-specific library path(s) may be modified as needed with mod_env, so there is no loss of functionality with this change. The days of monolithic binaries are long gone, even on 1970's architectures, and PATH should not be decoupled from the library path. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000593 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a4b6c03eba..ba015a6200 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,13 @@ - -*- coding: utf-8 -*- + -*- coding: utf-8 -*- Changes with Apache 2.3.9 + *) core: For process invocation (cgi, fcgid, piped loggers and so forth) + pass the system library path (LD_LIBRARY_PATH or platform-specific + variables) along with the system PATH, by default. Both should be + overridden together as desired using PassEnv etc; see mod_env. + [William Rowe] + *) mod_cache: Give the cache provider the opportunity to choose to cache or not cache based on the buckets present in the brigade, such as the presence of a FILE bucket. diff --git a/server/util_script.c b/server/util_script.c index de6d4440ba..f5e4ef1210 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -124,9 +124,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) conn_rec *c = r->connection; const char *rem_logname; const char *env_path; -#if defined(WIN32) || defined(OS2) const char *env_temp; -#endif const char *host; const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in); const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts; @@ -191,7 +189,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) } apr_table_addn(e, "PATH", apr_pstrdup(r->pool, env_path)); -#ifdef WIN32 +#if defined(WIN32) if (env_temp = getenv("SystemRoot")) { apr_table_addn(e, "SystemRoot", env_temp); } @@ -204,9 +202,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) if (env_temp = getenv("WINDIR")) { apr_table_addn(e, "WINDIR", env_temp); } -#endif - -#ifdef OS2 +#elif defined(OS2) if ((env_temp = getenv("COMSPEC")) != NULL) { apr_table_addn(e, "COMSPEC", env_temp); } @@ -219,6 +215,30 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) if ((env_temp = getenv("PERLLIB_PREFIX")) != NULL) { apr_table_addn(e, "PERLLIB_PREFIX", env_temp); } +#elif defined(BEOS) + if ((env_temp = getenv("LIBRARY_PATH")) != NULL) { + apr_table_addn(e, "LIBRARY_PATH", env_temp); + } +#elif defined(DARWIN) + if ((env_temp = getenv("DYLD_LIBRARY_PATH")) != NULL) { + apr_table_addn(e, "DYLD_LIBRARY_PATH", env_temp); + } +#elif defined(_AIX) + if ((env_temp = getenv("LIBPATH")) != NULL) { + apr_table_addn(e, "LIBPATH", env_temp); + } +#elif defined(__HPUX__) + /* HPUX PARISC 2.0W knows both, otherwise redundancy is harmless */ + if ((env_temp = getenv("SHLIB_PATH")) != NULL) { + apr_table_addn(e, "SHLIB_PATH", env_temp); + } + if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) { + apr_table_addn(e, "LD_LIBRARY_PATH", env_temp); + } +#else /* Some Unix */ + if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) { + apr_table_addn(e, "LD_LIBRARY_PATH", env_temp); + } #endif apr_table_addn(e, "SERVER_SIGNATURE", ap_psignature("", r));