Module: check_mk
Branch: master
Commit: be3f4d509ad461b031ac474edb4745e504bc2cbd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be3f4d509ad461…
Author: Andreas Umbreit <au(a)mathias-kettner.de>
Date: Thu Jul 5 07:57:11 2018 +0200
CMK-563: Add Werk 5502
5502 FIX Prevent baked tar.gz agents from changing ownership of files on host
When extracting a tar.gz packaged agent from the agent bakery as root (as it is normallly done), the user and group ownerships of the extracted files would be set to the Check_MK site user, if such user is available on the target host. This would lead to a wrong ownership on some folders like "/etc", "/usr" and "/var".
In order to prevent this, the agent bakery now creates the tar.gz packages correctly by setting an ownership of "root".
Change-Id: I0337aaddf8bed83a8cc03c5908415fabbd0be40f
---
.werks/5502 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.werks/5502 b/.werks/5502
new file mode 100644
index 0000000..da33566
--- /dev/null
+++ b/.werks/5502
@@ -0,0 +1,13 @@
+Title: Prevent baked tar.gz agents from changing ownership of files on host
+Level: 1
+Component: agents
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.6.0i1
+Date: 1530769691
+
+When extracting a tar.gz packaged agent from the agent bakery as root (as it is normallly done), the user and group ownerships of the extracted files would be set to the Check_MK site user, if such user is available on the target host. This would lead to a wrong ownership on some folders like "/etc", "/usr" and "/var".
+
+In order to prevent this, the agent bakery now creates the tar.gz packages correctly by setting an ownership of "root".
Module: check_mk
Branch: master
Commit: 2368f3360932477a815084bda081f556efe60f0f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2368f336093247…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 5 16:24:17 2018 +0200
Fixed unintended change in Encoder.urlencode_vars()
* GUI craw found this. Thanks!
* Extended the unit tests to find this earlier in the future
Change-Id: I0335bd628c4d0a05c5e264fad790cbe7ab407ba1
---
tests/unit/web/test_htmllib_Encoder.py | 1 +
web/htdocs/htmllib.py | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/tests/unit/web/test_htmllib_Encoder.py b/tests/unit/web/test_htmllib_Encoder.py
index 74dfa83..4f51047 100644
--- a/tests/unit/web/test_htmllib_Encoder.py
+++ b/tests/unit/web/test_htmllib_Encoder.py
@@ -22,6 +22,7 @@ def test_htmllib_integration(register_builtin_html):
([("a", "+")], "a=%2B"),
([("a", " ")], "a=+"),
([("a", "/")], "a=%2F"),
+ ([("a", None)], "a="),
])
def test_urlencode_vars(inp, out):
result = htmllib.Encoder().urlencode_vars(inp)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 3e516db..1512f15 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -183,6 +183,12 @@ class Encoder(object):
value = str(value)
elif type(value) == unicode:
value = value.encode("utf-8")
+ elif value is None:
+ # TODO: This is not ideal and should better be cleaned up somehow. Shouldn't
+ # variables with None values simply be skipped? We currently can not find the
+ # call sites easily. This may be cleaned up once we establish typing. Until then
+ # we need to be compatible with the previous behavior.
+ value = ""
#assert type(value) == str, "%s: %s" % (varname, value)