]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Phil Oester <kernel@linuxace.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Feb 2011 04:32:37 +0000 (21:32 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Feb 2011 04:32:37 +0000 (21:32 -0700)
Bug 3115: stdio: log module segfaults if access_log is set to a directory

src/log/ModStdio.cc

index e9d704b68cde7caac9b2d4296c22c4d75af97be1..ec646d35b0ff9b4d539d202e2c55753a6003a5bf 100644 (file)
@@ -206,6 +206,8 @@ logfile_mod_stdio_open(Logfile * lf, const char *path, size_t bufsz, int fatal_f
                    "\tThe parent directory must be writeable by the\n"
                    "\tuser '%s', which is the cache_effective_user\n"
                    "\tset in squid.conf.", path, Config.effectiveUser);
+        } else if (EISDIR == errno && fatal_flag) {
+            fatalf("Cannot open '%s' because it is a directory, not a file.\n", path);
         } else {
             debugs(50, DBG_IMPORTANT, "logfileOpen (stdio): " <<  path << ": " << xstrerror());
             return 0;