Module: check_mk
Branch: master
Commit: 2e4f32891d3776b3a0a9d1b091ca28dceaffebc7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e4f32891d3776…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 6 16:25:23 2017 +0100
4324 FIX Fixed possible exception when saving user with special characters in user name
Change-Id: I65b1f1d5ce896adb71ad6eb9cec00cce3df13b46
---
.werks/4324 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/userdb.py | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4324 b/.werks/4324
new file mode 100644
index 0000000..c22200f
--- /dev/null
+++ b/.werks/4324
@@ -0,0 +1,9 @@
+Title: Fixed possible exception when saving user with special characters in user name
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486394692
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index a49746c..1e43620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -134,6 +134,7 @@
* 4317 FIX: Rule list: Removed the row limit of the rule tables
* 4318 FIX: Rule editor: Fixed wrong default value for yes/no rulesets
* 4323 FIX: Fixed wrong %s in notification rule title deletion confirm dialog
+ * 4324 FIX: Fixed possible exception when saving user with special characters in user
name
Notifications:
* 4197 FIX: Fix sending notification to global fallback email address
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 3ca11ad..8fc965e 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -729,7 +729,7 @@ def save_users(profiles):
# Write user specific files
for user_id, user in profiles.items():
- user_dir = cmk.paths.var_dir + "/web/" + user_id
+ user_dir = cmk.paths.var_dir + "/web/" +
user_id.encode("utf-8")
make_nagios_directory(user_dir)
# authentication secret for local processes
@@ -737,7 +737,7 @@ def save_users(profiles):
if "automation_secret" in user:
store.save_file(auth_file, "%s\n" %
user["automation_secret"])
elif os.path.exists(auth_file):
- os.unlink(make_utf8(auth_file))
+ os.unlink(auth_file)
# Write out user attributes which are written to dedicated files in the user
# profile directory. The primary reason to have separate files, is to reduce