Module: check_mk
Branch: master
Commit: 9c9ecbff3dc93627e449b0731aef1832db2c9d6f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c9ecbff3dc936…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 19 20:34:07 2016 +0100
4143 FIX Fixed possible log spam "MKAuthException: Invalid credentials" in
web.log
When having multiple independent sites on one system, a log flood (one entry
for each request) may happen when having cookies from both sites to var/log/web.log.
Change-Id: Ie6863b2f527952421b2db5fc767638ca5e3106ee
---
.werks/4143 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/login.py | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/.werks/4143 b/.werks/4143
new file mode 100644
index 0000000..82b0d8d
--- /dev/null
+++ b/.werks/4143
@@ -0,0 +1,10 @@
+Title: Fixed possible log spam "MKAuthException: Invalid credentials" in
web.log
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i4
+Date: 1482175956
+Class: fix
+
+When having multiple independent sites on one system, a log flood (one entry
+for each request) may happen when having cookies from both sites to var/log/web.log.
diff --git a/ChangeLog b/ChangeLog
index 44bf361..fc25104 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
+ * 4143 FIX: Fixed possible log spam "MKAuthException: Invalid credentials"
in web.log...
WATO:
* 4142 New extended search dialog for rulesets and rules...
diff --git a/web/htdocs/login.py b/web/htdocs/login.py
index 70e86bd..3ba592c 100644
--- a/web/htdocs/login.py
+++ b/web/htdocs/login.py
@@ -313,6 +313,11 @@ def check_auth_by_cookie():
try:
set_auth_type("cookie")
return check_auth_cookie(cookie_name)
+ except MKAuthException:
+ # Suppress cookie validation errors from other sites cookies
+ if config.debug:
+ logger(LOG_ERR, 'Exception while checking cookie %s: %s' %
+ (cookie_name, traceback.format_exc()))
except Exception, e:
logger(LOG_ERR, 'Exception while checking cookie %s: %s' %
(cookie_name, traceback.format_exc()))