Module: check_mk
Branch: master
Commit: fad2266a8efde658fbabc7d22b6711bbce03bd8e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fad2266a8efde6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 5 10:26:19 2015 +0100
#1936 FIX check_form_submit: fixed crash on certain form fields with unnamed input
elements
---
.werks/1936 | 10 ++++++++++
ChangeLog | 1 +
doc/treasures/active_checks/check_form_submit | 5 ++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/1936 b/.werks/1936
new file mode 100644
index 0000000..db65719
--- /dev/null
+++ b/.werks/1936
@@ -0,0 +1,10 @@
+Title: check_form_submit: fixed crash on certain form fields with unnamed input elements
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1423128338
+
+
diff --git a/ChangeLog b/ChangeLog
index b3059f6..340d9e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -143,6 +143,7 @@
* 1931 FIX: agent_vsphere: no longer crashes when host has no license information
* 1932 FIX: check_http: Check SSL Certificate: did not work when SNI Option was
set...
* 1975 FIX: check_bi_aggr: Ignoring proxy settings from environment now
+ * 1936 FIX: check_form_submit: fixed crash on certain form fields with unnamed input
elements
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/doc/treasures/active_checks/check_form_submit
b/doc/treasures/active_checks/check_form_submit
index 134c469..8b9f160 100755
--- a/doc/treasures/active_checks/check_form_submit
+++ b/doc/treasures/active_checks/check_form_submit
@@ -232,7 +232,10 @@ class FormParser(HTMLParser):
if self.current_form is None:
debug('Ignoring form field out of form tag')
else:
- self.current_form['elements'][attrs['name']] =
attrs.get('value', '')
+ if 'name' in attrs:
+ self.current_form['elements'][attrs['name']] =
attrs.get('value', '')
+ else:
+ debug('Ignoring form field without name %r' % attrs)
def handle_endtag(self, tag):
if tag == 'form':