You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rj...@apache.org on 2009/03/20 18:37:18 UTC

svn commit: r756675 - /httpd/httpd/trunk/modules/metadata/mod_mime_magic.c

Author: rjung
Date: Fri Mar 20 17:37:18 2009
New Revision: 756675

URL: http://svn.apache.org/viewvc?rev=756675&view=rev
Log:
Creating the external gzip process fails, because we
call execve() with "gzip" without full path.
Let's look for it in the PATH instead and drop the
passing of the environment. There seems to be no
reason why gzip should need the httpd environment.

Modified:
    httpd/httpd/trunk/modules/metadata/mod_mime_magic.c

Modified: httpd/httpd/trunk/modules/metadata/mod_mime_magic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_mime_magic.c?rev=756675&r1=756674&r2=756675&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_mime_magic.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_mime_magic.c Fri Mar 20 17:37:18 2009
@@ -2121,7 +2121,6 @@
 {
     int rc = 1;
     const char *new_argv[4];
-    const char *const *env;
     request_rec *r = parm->r;
     apr_pool_t *child_context = cntxt;
     apr_procattr_t *procattr;
@@ -2133,14 +2132,12 @@
      * Should we create the err pipe, read it, and copy to the log?
      */
 
-    env = (const char *const *)ap_create_environment(child_context, r->subprocess_env);
-
     if ((apr_procattr_create(&procattr, child_context) != APR_SUCCESS) ||
         (apr_procattr_io_set(procattr, APR_FULL_BLOCK,
                            APR_FULL_BLOCK, APR_NO_PIPE)   != APR_SUCCESS) ||
         (apr_procattr_dir_set(procattr,
                               ap_make_dirstr_parent(r->pool, r->filename)) != APR_SUCCESS) ||
-        (apr_procattr_cmdtype_set(procattr, APR_PROGRAM)    != APR_SUCCESS)) {
+        (apr_procattr_cmdtype_set(procattr, APR_PROGRAM_PATH) != APR_SUCCESS)) {
         /* Something bad happened, tell the world. */
         ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
                "couldn't setup child process: %s", r->filename);
@@ -2153,7 +2150,7 @@
 
         procnew = apr_pcalloc(child_context, sizeof(*procnew));
         rc = apr_proc_create(procnew, compr[parm->method].argv[0],
-                               new_argv, env, procattr, child_context);
+                               new_argv, NULL, procattr, child_context);
 
         if (rc != APR_SUCCESS) {
             /* Bad things happened. Everyone should have cleaned up. */