From: Rainer Jung Date: Fri, 20 Mar 2009 17:37:18 +0000 (+0000) Subject: Creating the external gzip process fails, because we X-Git-Tag: 2.3.2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6ff006e1f86e3572102e40eec1e507f592cf87c;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@756675 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index b22f79ef4b..96ac989ae9 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -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. */