aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs19
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs33
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs42
3 files changed, 68 insertions, 26 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index af4fb37..d18937e 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -80,6 +80,21 @@ namespace OpenSim.Region.Communications.Local
80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running."); 80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running.");
81 } 81 }
82 return data; 82 return data;
83 } 83 }
84
85 public override bool AuthenticateUserByPassword(UUID userID, string password)
86 {
87 UserProfileData userProfile = GetUserProfile(userID);
88
89 if (null == userProfile)
90 return false;
91
92 string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt);
93
94 if (md5PasswordHash == userProfile.PasswordHash)
95 return true;
96 else
97 return false;
98 }
84 } 99 }
85} 100} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index dff8305..51ba2e9 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -140,6 +140,37 @@ namespace OpenSim.Region.Communications.OGS1
140 { 140 {
141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID); 141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID);
142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID); 142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID);
143 } 143 }
144
145 public override bool AuthenticateUserByPassword(UUID userID, string password)
146 {
147 Hashtable param = new Hashtable();
148 param["user_uuid"] = userID.ToString();
149 param["password"] = password;
150 IList parameters = new ArrayList();
151 parameters.Add(param);
152 XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
153 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
154
155 // Temporary measure to deal with older services
156 if (resp.IsFault && resp.FaultCode == XmlRpcErrorCodes.SERVER_ERROR_METHOD)
157 {
158 throw new Exception(
159 String.Format(
160 "XMLRPC method 'authenticate_user_by_password' not yet implemented by user service at {0}",
161 m_commsManager.NetworkServersInfo.UserURL));
162 }
163
164 Hashtable respData = (Hashtable)resp.Value;
165
166 if ((string)respData["auth_user"] == "TRUE")
167 {
168 return true;
169 }
170 else
171 {
172 return false;
173 }
174 }
144 } 175 }
145} \ No newline at end of file 176} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 196205c..55dce05 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
322 /// <param name="pass">User password</param> 322 /// <param name="pass">User password</param>
323 /// <returns></returns> 323 /// <returns></returns>
324 protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass) 324 protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
325 { 325 {
326 CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); 326 CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
327 //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName); 327 //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
328 if (null == userInfo) 328 if (null == userInfo)
@@ -333,29 +333,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
333 return null; 333 return null;
334 } 334 }
335 335
336 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt); 336 try
337 337 {
338 if (userInfo.UserProfile.PasswordHash == null || userInfo.UserProfile.PasswordHash == String.Empty) 338 if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
339 { 339 {
340 m_log.ErrorFormat( 340 return userInfo;
341 "[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"); 341 }
342 342 else
343 return null; 343 {
344 m_log.ErrorFormat(
345 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
346 firstName, lastName);
347 return null;
348 }
344 } 349 }
345 350 catch (Exception e)
346// m_log.DebugFormat(
347// "[INVENTORY ARCHIVER]: received salt {0}, hash {1}, supplied hash {2}",
348// userInfo.UserProfile.PasswordSalt, userInfo.UserProfile.PasswordHash, md5PasswdHash);
349
350 if (userInfo.UserProfile.PasswordHash != md5PasswdHash)
351 { 351 {
352 m_log.ErrorFormat( 352 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
353 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
354 firstName, lastName);
355 return null; 353 return null;
356 } 354 }
357
358 return userInfo;
359 } 355 }
360 356
361 /// <summary> 357 /// <summary>
@@ -375,9 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
375 { 371 {
376 foreach (InventoryNodeBase node in loadedNodes) 372 foreach (InventoryNodeBase node in loadedNodes)
377 { 373 {
378 m_log.DebugFormat( 374// m_log.DebugFormat(
379 "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}", 375// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
380 user.Name, node.Name); 376// user.Name, node.Name);
381 377
382 user.ControllingClient.SendBulkUpdateInventory(node); 378 user.ControllingClient.SendBulkUpdateInventory(node);
383 } 379 }