From 7870152d23db4cb6f5834d4921fac17feb717220 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 24 Sep 2009 14:54:12 +0100
Subject: Allow load/save iar password checks to be done in grid mode This
should allow load/save iar to work for grid mode as long as the grid user
service is later than this revision Grid services of earlier revisions will
always erroneously report incorrect password. This will be addressed
shortly.
---
.../Inventory/Archiver/InventoryArchiverModule.cs | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 196205c..b82b940 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// User password
///
protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
- {
+ {
CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
//m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
if (null == userInfo)
@@ -333,29 +333,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
}
- string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt);
-
- if (userInfo.UserProfile.PasswordHash == null || userInfo.UserProfile.PasswordHash == String.Empty)
+ if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
{
- m_log.ErrorFormat(
- "[INVENTORY ARCHIVER]: Sorry, the grid mode service is not providing password hash details for the check. This will be fixed in an OpenSim git revision soon");
-
- return null;
+ return userInfo;
}
-
-// m_log.DebugFormat(
-// "[INVENTORY ARCHIVER]: received salt {0}, hash {1}, supplied hash {2}",
-// userInfo.UserProfile.PasswordSalt, userInfo.UserProfile.PasswordHash, md5PasswdHash);
-
- if (userInfo.UserProfile.PasswordHash != md5PasswdHash)
+ else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
firstName, lastName);
+
return null;
}
-
- return userInfo;
}
///
--
cgit v1.1
From f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 24 Sep 2009 15:19:47 +0100
Subject: Produce a different error message if the user service does not have
the authenticate method available
---
.../Inventory/Archiver/InventoryArchiverModule.cs | 29 ++++++++++++++--------
1 file changed, 18 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index b82b940..55dce05 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -333,16 +333,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return null;
}
- if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
- {
- return userInfo;
+ try
+ {
+ if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
+ {
+ return userInfo;
+ }
+ else
+ {
+ m_log.ErrorFormat(
+ "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
+ firstName, lastName);
+ return null;
+ }
}
- else
+ catch (Exception e)
{
- m_log.ErrorFormat(
- "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
- firstName, lastName);
-
+ m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
return null;
}
}
@@ -364,9 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
foreach (InventoryNodeBase node in loadedNodes)
{
- m_log.DebugFormat(
- "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
- user.Name, node.Name);
+// m_log.DebugFormat(
+// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
+// user.Name, node.Name);
user.ControllingClient.SendBulkUpdateInventory(node);
}
--
cgit v1.1