]> granicus.if.org Git - apache/commitdiff
Creating the external gzip process fails, because we
authorRainer Jung <rjung@apache.org>
Fri, 20 Mar 2009 17:37:18 +0000 (17:37 +0000)
committerRainer Jung <rjung@apache.org>
Fri, 20 Mar 2009 17:37:18 +0000 (17:37 +0000)
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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@756675 13f79535-47bb-0310-9956-ffa450edef68

modules/metadata/mod_mime_magic.c

index b22f79ef4bcc001f0b4bfb3c1fa77a743d8ece1f..96ac989ae9c86c43fb6c6b81ac1d542694349f13 100644 (file)
@@ -2121,7 +2121,6 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn
 {
     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 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn
      * 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 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn
 
         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. */