From 4c9cc56624188b6b00d18327662d6d0191cc4e5e Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 2 Apr 2010 13:32:30 -0700 Subject: [PATCH] * Better logging for Authenticate() failures * Changed a warning message to debug when fetching user sessions --- .../SimianAuthenticationServiceConnector.cs | 12 ++++++++++-- .../SimianGrid/SimianPresenceServiceConnector.cs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index e78429d29b..b19135e0c5 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -104,6 +104,8 @@ namespace OpenSim.Services.Connectors.SimianGrid OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); if (response["Success"].AsBoolean() && response["Identities"] is OSDArray) { + bool md5hashFound = false; + OSDArray identities = (OSDArray)response["Identities"]; for (int i = 0; i < identities.Count; i++) { @@ -114,13 +116,19 @@ namespace OpenSim.Services.Connectors.SimianGrid { string credential = identity["Credential"].AsString(); - if (password == credential || "$1$" + Utils.MD5String(password) == credential) + if (password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) return Authorize(principalID); + + md5hashFound = true; + break; } } } - m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID); + if (md5hashFound) + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password)); + else + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found"); } else { diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index 696be94ce9..c324272093 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -395,7 +395,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } else { - m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString()); + m_log.Debug("[SIMIAN PRESENCE CONNECTOR]: No session returned for " + userID + ": " + response["Message"].AsString()); } }