From f7ab3be8b1b60d0f833af4bd614cc71b896cbd20 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 14 May 2009 12:59:25 +0000 Subject: [PATCH] Allow relative pathnames for piped loggers in ErrorLog. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774755 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ server/log.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c889624c18..5c812d780c 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Changes with Apache 2.3.3 mod_proxy_ajp: Avoid delivering content from a previous request which failed to send a request body. PR 46949 [Ruediger Pluem] + *) core: Allow relative pathnames for piped loggers in ErrorLog. + [Rainer Jung] + *) Windows: Fix usage message. [Rainer Jung] diff --git a/server/log.c b/server/log.c index c830faf8ba..e1662aebc1 100644 --- a/server/log.c +++ b/server/log.c @@ -320,16 +320,24 @@ static int open_error_log(server_rec *s, int is_main, apr_pool_t *p) if (*s->error_fname == '|') { apr_file_t *dummy = NULL; + fname = ap_server_root_relative(p, s->error_fname + 1); + + if (!fname) { + ap_log_error(APLOG_MARK, APLOG_STARTUP, APR_EBADPATH, NULL, + "%s: Invalid error log path %s.", + ap_server_argv0, s->error_fname); + return DONE; + } /* Spawn a new child logger. If this is the main server_rec, * the new child must use a dummy stderr since the current * stderr might be a pipe to the old logger. Otherwise, the * child inherits the parents stderr. */ - rc = log_child(p, s->error_fname + 1, &dummy, is_main); + rc = log_child(p, fname, &dummy, is_main); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, "Couldn't start ErrorLog process '%s'.", - s->error_fname + 1); + fname); return DONE; } -- 2.40.0