Module: check_mk
Branch: master
Commit: a863af50eeb211becadb50d8821fa14514a2b243
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a863af50eeb211…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 16:19:51 2016 +0100
#3053 FIX Fixed broken login with Python 2.4 (e.g. on CentOS 5.x systems)
---
.werks/3053 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/html_mod_python.py | 8 ++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/3053 b/.werks/3053
new file mode 100644
index 0000000..ba437b6
--- /dev/null
+++ b/.werks/3053
@@ -0,0 +1,9 @@
+Title: Fixed broken login with Python 2.4 (e.g. on CentOS 5.x systems)
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1455203973
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 8d34471..eff1840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -325,6 +325,7 @@
* 3171 FIX: Logout in one site will log out of all sites sharing the same
auth.secret...
* 3048 FIX: It is now possible to add a context filter right after removing it from a
view again...
* 3050 FIX: Fixed broken "Host state (first character)" painter
+ * 3053 FIX: Fixed broken login with Python 2.4 (e.g. on CentOS 5.x systems)
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 40a4752..b1ebba0 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -183,8 +183,12 @@ class html_mod_python(htmllib.html):
def set_cookie(self, varname, value, expires = None):
- # httponly tells the browser not to make this cookie available to Javascript
- c = Cookie.Cookie(varname, make_utf8(value), path='/', httponly=True)
+ # httponly tells the browser not to make this cookie available to Javascript.
+ # But it is only available from Python 2.6+. Be compatible.
+ try:
+ c = Cookie.Cookie(varname, make_utf8(value), path='/',
httponly=True)
+ except AttributeError:
+ c = Cookie.Cookie(varname, make_utf8(value), path='/')
if self.is_ssl_request():
c.secure = True