]> 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>
Fri, 18 Mar 2016 12:05:14 +0000 (01:05 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Mar 2016 12:05:14 +0000 (01:05 +1300)
src/debug.cc

index 2a39a6ad9572b4e80440ff2b826a916076985967..1e13e1d6173c13c1ec7bf69eb77c3ebc26c4af13 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);