Module: check_mk
Branch: master
Commit: 84f69ad53ba14c7f5f627cf2ed6e62fee7ab100a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=84f69ad53ba14c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 17 10:06:27 2013 +0100
FIX LDAP: Now handling user-ids with umlauts
User-IDs with umlauts seem to be used in some installations. We added one new configuration
options to handle those User-IDs. The default is now that multisite replaces the umlauts
ü, ö, ä, ß with two letters ue, oe, ae, ss. Other umlauts are left untouched. Another option
is that users with umlauts are simply skipped and not synced into multisite.
Please note: Users with umlauts need to login with their umlaut login name. After login, the
username is always used without umlauts within multisite.
Maybe we make multisite handle umlauts correctly one day, but for the moment this change
could have too many unwanted results.
---
.werks/375 | 19 +++++++++++
ChangeLog | 1 +
web/plugins/config/builtin.py | 5 ++-
web/plugins/userdb/ldap.py | 49 +++++++++++++++++++++-------
web/plugins/wato/check_mk_configuration.py | 13 +++++++-
5 files changed, 73 insertions(+), 14 deletions(-)
diff --git a/.werks/375 b/.werks/375
new file mode 100644
index 0000000..3f7a792
--- /dev/null
+++ b/.werks/375
@@ -0,0 +1,19 @@
+Title: LDAP: Now handling user-ids with umlauts
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387270969
+Targetversion: future
+
+User-IDs with umlauts seem to be used in some installations. We added one new configuration
+options to handle those User-IDs. The default is now that multisite replaces the umlauts
+ü, ö, ä, ß with two letters ue, oe, ae, ss. Other umlauts are left untouched. Another option
+is that users with umlauts are simply skipped and not synced into multisite.
+
+Please note: Users with umlauts need to login with their umlaut login name. After login, the
+username is always used without umlauts within multisite.
+
+Maybe we make multisite handle umlauts correctly one day, but for the moment this change
+could have too many unwanted results.
diff --git a/ChangeLog b/ChangeLog
index 6ca7559..b89185e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,7 @@
* 0356 FIX: Fixed exception caused by utf8 chars in tooltip text...
* 0368 FIX: Generating selection id is hopefully now compatible to more systems...
* 0374 FIX: Fixed syntax error in exception handler of LDAP search code...
+ * 0375 FIX: LDAP: Now handling user-ids with umlauts...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/plugins/config/builtin.py b/web/plugins/config/builtin.py
index c5a3b1a..fd285d8 100644
--- a/web/plugins/config/builtin.py
+++ b/web/plugins/config/builtin.py
@@ -215,7 +215,10 @@ escape_plugin_output = True
user_connectors = ['htpasswd']
userdb_automatic_sync = [ 'wato_users', 'page', 'wato_pre_activate_changes', 'wato_snapshot_pushed' ]
ldap_connection = {}
-ldap_userspec = {}
+ldap_userspec = {
+ 'scope' : 'sub',
+ 'user_id_umlauts' : 'replace',
+}
ldap_groupspec = {}
ldap_active_plugins = {'email': {}, 'alias': {}, 'auth_expire': {}}
ldap_cache_livetime = 300
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index bf14356..ca1fd6c 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -399,6 +399,36 @@ def ldap_replace_macros(tmpl):
return dn
+def ldap_rewrite_user_id(user_id):
+ if config.ldap_userspec.get('lower_user_ids', False):
+ user_id = user_id.lower()
+
+ umlauts = config.ldap_userspec.get('user_id_umlauts', 'replace')
+ new = ""
+ for c in user_id:
+ if c == u'ü':
+ new += 'ue'
+ elif c == u'ö':
+ new += 'oe'
+ elif c == u'ä':
+ new += 'ae'
+ elif c == u'ß':
+ new += 'ss'
+ elif c == u'Ü':
+ new += 'UE'
+ elif c == u'Ö':
+ new += 'OE'
+ elif c == u'Ä':
+ new += 'AE'
+ else:
+ new += c
+ if umlauts == 'replace':
+ user_id = new
+ elif umlauts == 'skip' and user_id != new:
+ return None # This makes the user being skipped
+
+ return user_id
+
def ldap_user_id_attr():
return config.ldap_userspec.get('user_id', ldap_attr('user_id'))
@@ -430,11 +460,9 @@ def ldap_get_user(username, no_escape = False):
if result:
dn = result[0][0]
- user_id = result[0][1][ldap_user_id_attr()][0]
-
- if config.ldap_userspec.get('lower_user_ids', False):
- user_id = user_id.lower()
-
+ user_id = ldap_rewrite_user_id(result[0][1][ldap_user_id_attr()][0])
+ if user_id is None:
+ return None
g_ldap_user_cache[username] = (dn, user_id)
if no_escape:
@@ -488,13 +516,10 @@ def ldap_get_users(add_filter = ''):
if ldap_user_id_attr() not in ldap_user:
raise MKLDAPException(_('The configured User-ID attribute "%s" does not '
'exist for the user "%s"') % (ldap_user_id_attr(), dn))
- user_id = ldap_user[ldap_user_id_attr()][0]
-
- if config.ldap_userspec.get('lower_user_ids', False):
- user_id = user_id.lower()
-
- ldap_user['dn'] = dn # also add the DN
- result[user_id] = ldap_user
+ user_id = ldap_rewrite_user_id(ldap_user[ldap_user_id_attr()][0])
+ if user_id:
+ ldap_user['dn'] = dn # also add the DN
+ result[user_id] = ldap_user
return result
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 2a25018..5ffabb5 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -698,8 +698,19 @@ register_configvar(group,
value = True,
totext = _("Enforce lower case User-IDs."),
)),
+ ("user_id_umlauts", DropdownChoice(
+ title = _("Umlauts in User-IDs"),
+ help = _("Multisite does not support umlauts in User-IDs at the moment. To deal "
+ "with LDAP users having umlauts in their User-IDs you have the following "
+ "choices."),
+ choices = [
+ ("replace", _("Replace umlauts like \"ü\" with \"ue\"")),
+ ("skip", _("Skip users with umlauts in their User-IDs")),
+ ],
+ default_value = "replace",
+ )),
],
- optional_keys = ['scope', 'filter', 'filter_group', 'user_id', 'lower_user_ids'],
+ optional_keys = ['filter', 'filter_group', 'user_id', 'lower_user_ids', ],
),
domain = "multisite",
in_global_settings = False,
Module: check_mk
Branch: master
Commit: 0b97347881693169485aeb1685d2900f6568aee9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0b973478816931…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 17 10:07:46 2013 +0100
FIX: Linux agent: fix detaching of background plugins
The asynchronous execution of background processes in the Linux agent has
been fixed. Before it could have happened that the agent starts background
processes but - however - waits for all of them to finish until finishing
itself. This has now been fixed. All plugins started with run_cached are
now correctly detached from the agent.
---
.werks/345 | 14 ++++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 2 +-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/345 b/.werks/345
new file mode 100644
index 0000000..fed7f1f
--- /dev/null
+++ b/.werks/345
@@ -0,0 +1,14 @@
+Title: Linux agent: fix detaching of background plugins
+Level: 2
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387270406
+Targetversion: future
+
+The asynchronous execution of background processes in the Linux agent has
+been fixed. Before it could have happened that the agent starts background
+processes but - however - waits for all of them to finish until finishing
+itself. This has now been fixed. All plugins started with run_cached are
+now correctly detached from the agent.
diff --git a/ChangeLog b/ChangeLog
index 6ca7559..0ad4f89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,7 @@
* 0369 FIX: cups_queues: Fixed bug checking the last queue reported by agent...
* 0370 FIX: brocade_mlx_module*: Improved output of checks
* 0372 FIX: megaraid_ldisks: Ignoring adapters without configured logical disks...
+ * 0345 FIX: Linux agent: fix detaching of background plugins...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 28453ad..2f67328 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -88,7 +88,7 @@ function run_cached () {
# Cache file outdated and new job not yet running? Start it
if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
- echo "$CMDLINE" | setsid bash -o noclobber > $CACHEFILE.new && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new &
+ echo "set -o noclobber ; exec > $CACHEFILE.new || exit 1 ; $CMDLINE && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new" | nohup bash 2>/dev/null &
fi
}
Module: check_mk
Branch: master
Commit: cede101c08feafef766b4e3298fcf7acec7d3910
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cede101c08feaf…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 19:36:27 2013 +0100
FIX Fix semantics of columns num_services_hard_*
In the tables <tt>hosts</tt> and <tt>servicegroups</tt> the columns
<tt>num_services_hard_warn</tt>, <tt>num_services_hard_crit</tt> and
<tt>num_services_hard_unknown<tt> did not correctly reflect the
hard status but in most cases just the soft status - effectively
ignoring the <tt>_hard_</tt>. This has now been fixed.
---
.werks/344 | 14 ++++++++++++++
ChangeLog | 1 +
livestatus/src/ServicelistStateColumn.cc | 8 +++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/344 b/.werks/344
new file mode 100644
index 0000000..36054cf
--- /dev/null
+++ b/.werks/344
@@ -0,0 +1,14 @@
+Title: Fix semantics of columns num_services_hard_*
+Level: 1
+Component: livestatus
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387218771
+Targetversion: future
+
+In the tables <tt>hosts</tt> and <tt>servicegroups</tt> the columns
+<tt>num_services_hard_warn</tt>, <tt>num_services_hard_crit</tt> and
+<tt>num_services_hard_unknown<tt> did not correctly reflect the
+hard status but in most cases just the soft status - effectively
+ignoring the <tt>_hard_</tt>. This has now been fixed.
diff --git a/ChangeLog b/ChangeLog
index fc739f0..f49b2a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
* 0337 New header for limiting the execution time of a query...
* 0335 FIX: Parse state of downtime notification log entries correctly...
* 0336 FIX: Limit the number of lines read from a single logfile...
+ * 0344 FIX: Fix semantics of columns num_services_hard_*...
1.2.3i7:
diff --git a/livestatus/src/ServicelistStateColumn.cc b/livestatus/src/ServicelistStateColumn.cc
index a4f9064..7565091 100644
--- a/livestatus/src/ServicelistStateColumn.cc
+++ b/livestatus/src/ServicelistStateColumn.cc
@@ -51,22 +51,24 @@ int32_t ServicelistStateColumn::getValue(int logictype, servicesmember *mem, Que
{
contact *auth_user = query->authUser();
int32_t result = 0;
+ int lt;
while (mem) {
service *svc = mem->service_ptr;
if (!auth_user || g_table_services->isAuthorized(auth_user, svc)) {
+ int lt = logictype;
int state;
int has_been_checked;
if (logictype >= 60) {
state = svc->last_hard_state;
- logictype -= 64;
+ lt -= 64;
}
else
state = svc->current_state;
has_been_checked = svc->has_been_checked;
- switch (logictype) {
+ switch (lt) {
case SLSC_WORST_STATE:
if (svcStateIsWorse(state, result))
result = state;
@@ -79,7 +81,7 @@ int32_t ServicelistStateColumn::getValue(int logictype, servicesmember *mem, Que
result++;
break;
default:
- if (has_been_checked && state == logictype)
+ if (has_been_checked && state == lt)
result++;
break;
}