Commit 394bc0c0 authored by Yann Ylavic's avatar Yann Ylavic
Browse files

core: use strncmp in check_errorlog_dir and core_dump_config when checking

if the ErrorLog directive is configured with the 'syslog' prefix. PR 62102

trunk patch: none, as far as I can see the code in trunk diverged too much
          due to the code in STALLED for ap_errorlog_provider.
 
Submitted by: elukey, jhriggs, jailletc36
Reviewed by: elukey, jhriggs, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1832493 13f79535-47bb-0310-9956-ffa450edef68
parent 3c5b7b8a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.4.34

  *) core, log: improve sanity checks for the ErrorLog's syslog config, and
     explicitly allow ony lowercase 'syslog' settings. PR 62102
     [Luca Toscano, Jim Riggs, Christophe Jaillet]

  *) mod_http2: accurate reporting of h2 data input/output per request via mod_logio. Fixes
     an issue where output sizes where counted n-times on reused slave connections. See
     gituhub issue: https://github.com/icing/mod_h2/issues/158
+5 −2
Original line number Diff line number Diff line
@@ -4867,7 +4867,8 @@ AP_DECLARE(int) ap_sys_privileges_handlers(int inc)
static int check_errorlog_dir(apr_pool_t *p, server_rec *s)
{
    if (!s->error_fname || s->error_fname[0] == '|'
        || strcmp(s->error_fname, "syslog") == 0) {
        || strcmp(s->error_fname, "syslog") == 0
        || strncmp(s->error_fname, "syslog:", 7) == 0) {
        return APR_SUCCESS;
    }
    else {
@@ -5281,7 +5282,9 @@ static void core_dump_config(apr_pool_t *p, server_rec *s)
    apr_file_printf(out, "ServerRoot: \"%s\"\n", ap_server_root);
    tmp = ap_server_root_relative(p, sconf->ap_document_root);
    apr_file_printf(out, "Main DocumentRoot: \"%s\"\n", tmp);
    if (s->error_fname[0] != '|' && strcmp(s->error_fname, "syslog") != 0)
    if (s->error_fname[0] != '|'
        && strcmp(s->error_fname, "syslog") != 0
        && strncmp(s->error_fname, "syslog:", 7) != 0)
        tmp = ap_server_root_relative(p, s->error_fname);
    else
        tmp = s->error_fname;
+2 −1
Original line number Diff line number Diff line
@@ -396,7 +396,8 @@ static int open_error_log(server_rec *s, int is_main, apr_pool_t *p)
    }

#ifdef HAVE_SYSLOG
    else if (!strncasecmp(s->error_fname, "syslog", 6)) {
    else if (strcmp(s->error_fname, "syslog") == 0
             || strncmp(s->error_fname, "syslog:", 7) == 0) {
        if ((fname = strchr(s->error_fname, ':'))) {
            /* s->error_fname could be [level]:[tag] (see #60525) */
            const char *tag;