From: Amos Jeffries Date: Wed, 23 Mar 2016 14:46:37 +0000 (+1300) Subject: Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error X-Git-Tag: SQUID_3_5_16~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf81382a56900d703f4f5fd1f486d8f10233a33;p=thirdparty%2Fsquid.git Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error --- diff --git a/src/debug.cc b/src/debug.cc index 81207deed4..7ee6e62d64 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -222,7 +222,14 @@ debugOpenLog(const char *logfile) if (debug_log && debug_log != stderr) fclose(debug_log); - debug_log = fopen(logfile, "a+"); + // Bug 4423: ignore the stdio: logging module name if present + const char *logfilename; + if (strncmp(logfile, "stdio:",6) == 0) + logfilename = logfile + 6; + else + logfilename = logfile; + + debug_log = fopen(logfilename, "a+"); if (!debug_log) { fprintf(stderr, "WARNING: Cannot write log file: %s\n", logfile);