From: William A. Rowe Jr Date: Fri, 15 May 2009 20:40:24 +0000 (+0000) Subject: Ease migration for the hosts of piped loggers out there, handle the X-Git-Tag: 2.3.3~561 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10d6aaf94bec5897d5b1459aef9fdab98b017ccb;p=thirdparty%2Fapache%2Fhttpd.git Ease migration for the hosts of piped loggers out there, handle the log process selection (| vs $ vs default) in ap_open_piped_log git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775320 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index d192723d9a0..2c34f316b96 100644 --- a/server/log.c +++ b/server/log.c @@ -1102,7 +1102,21 @@ AP_DECLARE(piped_log *) ap_open_piped_log_ex(apr_pool_t *p, AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program) { - return ap_open_piped_log_ex(p, program, APR_PROGRAM_ENV); + apr_cmdtype_e cmdtype = APR_PROGRAM_ENV; + + /* In 2.4 favor PROGRAM_ENV, accept "||prog" syntax for compatibility + * and "|$cmd" to override the default. + * Any 2.2 backport would continue to favor SHELLCMD_ENV so there + * accept "||prog" to override, and "|$cmd" to ease conversion. + */ + if (*program == '|') + ++program; + if (*program == '$') { + cmdtype = APR_SHELLCMD_ENV; + ++program; + } + + return ap_open_piped_log_ex(p, program, cmdtype); } AP_DECLARE(void) ap_close_piped_log(piped_log *pl)