]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 23 Mar 2016 14:46:37 +0000 (03:46 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 23 Mar 2016 14:46:37 +0000 (03:46 +1300)
src/debug.cc

index 81207deed4e1c3800fdaea0627d300e01a261556..7ee6e62d64694a2a064e87fe60e8bd4d989bba38 100644 (file)
@@ -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);