]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix 'access_log none' to prevent following logs being used
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 24 Apr 2015 04:15:29 +0000 (21:15 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 24 Apr 2015 04:15:29 +0000 (21:15 -0700)
The documented behaviour of "access_log none" for preventing logging
using log lines following the directive has not been working in
Squid-3 for some time.

Since the 'none' type does not have a log module associated the entire
switch logic where its abort is checked for was being skipped.

src/log/access_log.cc

index 4b383b9f16d381d252ef9a9373cc30173fd48938..9cdc2506fdd93305e618b2f4a5c95b5eb2f3c735 100644 (file)
@@ -96,6 +96,10 @@ accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * check
         if (log->aclList && checklist && checklist->fastCheck(log->aclList) != ACCESS_ALLOWED)
             continue;
 
+        // The special-case "none" type has no logfile object set
+        if (log->type == Log::Format::CLF_NONE)
+            return;
+
         if (log->logfile) {
             logfileLineStart(log->logfile);
 
@@ -131,9 +135,6 @@ accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * check
                 break;
 #endif
 
-            case Log::Format::CLF_NONE:
-                return; // abort!
-
             default:
                 fatalf("Unknown log format %d\n", log->type);
                 break;