Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=08c1e2...
Commit: 08c1e2ab3a725da2e192a245a078f09517256f98
Parent: b06d381452aa739e47682644bfea80ef1b834bcb
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jul 31 14:15:58 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jun 18 14:06:38 2014 +0200
fence_ilo2: Unable to login when password contains "
Resolves: rhbz#990537
Based on: 3a185569e825ee8e948a6cbef8bf847f6a7632dc
Conflicts:
fence/agents/ilo/fence_ilo.py
---
fence/agents/ilo/fence_ilo.py | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index d4e34df..2541729 100644
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -12,6 +12,7 @@
#####
import sys, re, pexpect, socket
+from xml.sax.saxutils import quoteattr
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
@@ -22,8 +23,8 @@ BUILD_DATE="March, 2008"
#END_VERSION_GENERATION
def get_power_status(conn, options):
- conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] +
"\"" + \
- " PASSWORD = \"" + options["-p"] +
"\">\r\n")
+ conn.send("<LOGIN USER_LOGIN = \"" +
quoteattr(options["-l"]) + "\"" + \
+ " PASSWORD = \"" + quoteattr(options["-p"]) +
"\">\r\n")
conn.send("<SERVER_INFO MODE =
\"read\"><GET_HOST_POWER_STATUS/>\r\n")
conn.send("</SERVER_INFO></LOGIN>\r\n")
try:
@@ -37,8 +38,8 @@ def get_power_status(conn, options):
return status.lower().strip()
def set_power_status(conn, options):
- conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] +
"\"" + \
- " PASSWORD = \"" + options["-p"] +
"\">\r\n")
+ conn.send("<LOGIN USER_LOGIN = \"" +
quoteattr(options["-l"]) + "\"" + \
+ " PASSWORD = \"" + quoteattr(options["-p"]) +
"\">\r\n")
conn.send("<SERVER_INFO MODE = \"write\">")
if options.has_key("fw_processor") and options["fw_processor"] ==
"iLO2":
@@ -101,8 +102,8 @@ the iLO card through an XML stream."
else:
conn.send("<RIBCL VERSION=\"1.2\">\r\n")
- conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] +
"\"" + \
- " PASSWORD = \"" + options["-p"] +
"\">\r\n")
+ conn.send("<LOGIN USER_LOGIN = \"" +
quoteattr(options["-l"]) + "\"" + \
+ " PASSWORD = \"" + quoteattr(options["-p"]) +
"\">\r\n")
if options["-r"] >= 2:
conn.send("<RIB_INFO MODE=\"read\"><GET_FW_VERSION
/>\r\n")
conn.send("</RIB_INFO>\r\n")