]> granicus.if.org Git - apache/commitdiff
Force the current directory to the server root in the invocation of the piped
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 15 May 2009 20:53:33 +0000 (20:53 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 15 May 2009 20:53:33 +0000 (20:53 +0000)
logger processes.

Looking for confirmation from Rainer that this resolves the ambiguity
he observed in Message-ID: <4A0C9430.2090404@kippdata.de>.

Note that the shell may decide to ignore the chdir, so test with "|$cmd"
syntax to compare to the expected behavior from 5/14 or earlier.

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

server/log.c

index 2c34f316b96a48cf74c3a696697d285e6bd76f35..cb5b3f98c66378f131b13c46451e640c23d79c2e 100644 (file)
@@ -309,6 +309,8 @@ static int log_child(apr_pool_t *p, const char *progname,
     apr_file_t *errfile;
 
     if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
+        && ((rc = apr_procattr_dir_set(procattr,
+                                       ap_server_root)) == APR_SUCCESS)
         && ((rc = apr_procattr_cmdtype_set(procattr, cmdtype)) == APR_SUCCESS)
         && ((rc = apr_procattr_io_set(procattr,
                                       APR_FULL_BLOCK,
@@ -912,6 +914,8 @@ static apr_status_t piped_log_spawn(piped_log *pl)
     apr_status_t status;
 
     if (((status = apr_procattr_create(&procattr, pl->p)) != APR_SUCCESS) ||
+        ((status = apr_procattr_dir_set(procattr, ap_server_root))
+         != APR_SUCCESS) ||
         ((status = apr_procattr_cmdtype_set(procattr, pl->cmdtype))
          != APR_SUCCESS) ||
         ((status = apr_procattr_child_in_set(procattr,