Module: check_mk
Branch: master
Commit: 33e6153327a916164463ce405b3d3ec200c7c63c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33e6153327a916…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Oct 2 11:48:54 2013 +0200
agent_vsphere: now able to handle < > & ' " in login credentials
---
ChangeLog | 1 +
agents/special/agent_vsphere | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 5bb6989..4c22169 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
* FIX: cups default printer is now monitored again in linux agent
* FIX: host notification email in html format: fixed formating error
(typo in tag)
+ * agent_vsphere: now able to handle < > & ' " in login
credentials
Multisite:
* FIX: add missing service icons to view "All Services with this descr..."
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 7565706..4580645 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -334,7 +334,15 @@ try:
# Prepare request data
if name == "2_login":
- soapdata = soapdata.replace("###user###",
user).replace("###secret###", secret)
+ def encode_url(text):
+ for char, replacement in [ ( "&", "&"),
+ ( ">", ">" ),
+ ( "<", "<"),
+ ( "'",
"'"),
+ ( "\"", """)
]:
+ text = text.replace(char, replacement)
+ return text
+ soapdata = soapdata.replace("###user###",
encode_url(user)).replace("###secret###", encode_url(secret))
elif name == "8_perf_counter_syntax":
needed_ids = get_counters(esx_version_num)
counter_data = []