aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorKitto Flora2010-06-17 13:04:32 -0400
committerKitto Flora2010-06-17 13:04:32 -0400
commitcea79056025950303e3b784d824d3cb6168152d0 (patch)
tree0e708850e10f2a6b65cf718264b526ff1a12b9c5 /OpenSim/Services
parentAdd rez on water surface. (diff)
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
downloadopensim-SC-cea79056025950303e3b784d824d3cb6168152d0.zip
opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.gz
opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.bz2
opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs9
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs53
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs2
-rw-r--r--OpenSim/Services/GridService/GridService.cs5
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs4
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs24
7 files changed, 72 insertions, 27 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index 0ec8912..1831533 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -210,9 +210,6 @@ namespace OpenSim.Services.Connectors
210 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r); 210 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
211 rinfos.Add(rinfo); 211 rinfos.Add(rinfo);
212 } 212 }
213 else
214 m_log.DebugFormat("[GRID CONNECTOR]: GetNeighbours {0}, {1} received invalid response type {2}",
215 scopeID, regionID, r.GetType());
216 } 213 }
217 } 214 }
218 else 215 else
@@ -299,9 +296,9 @@ namespace OpenSim.Services.Connectors
299 { 296 {
300 if (replyData["result"] is Dictionary<string, object>) 297 if (replyData["result"] is Dictionary<string, object>)
301 rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]); 298 rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]);
302 else 299 //else
303 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region", 300 // m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region",
304 scopeID, x, y); 301 // scopeID, x, y);
305 } 302 }
306 else 303 else
307 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received null response", 304 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received null response",
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index de3ee4e..3c784f2 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -114,10 +114,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
114 { 114 {
115 if (identity["Type"].AsString() == "md5hash") 115 if (identity["Type"].AsString() == "md5hash")
116 { 116 {
117 string credential = identity["Credential"].AsString(); 117 string authorizeResult;
118 118 if (CheckPassword(principalID, password, identity["Credential"].AsString(), out authorizeResult))
119 if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) 119 return authorizeResult;
120 return Authorize(principalID);
121 120
122 md5hashFound = true; 121 md5hashFound = true;
123 break; 122 break;
@@ -125,9 +124,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
125 } 124 }
126 } 125 }
127 126
128 if (md5hashFound) 127 if (!md5hashFound)
129 m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password));
130 else
131 m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found"); 128 m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found");
132 } 129 }
133 else 130 else
@@ -228,6 +225,48 @@ namespace OpenSim.Services.Connectors.SimianGrid
228 return false; 225 return false;
229 } 226 }
230 227
228 private bool CheckPassword(UUID userID, string password, string simianGridCredential, out string authorizeResult)
229 {
230 if (simianGridCredential.Contains(":"))
231 {
232 // Salted version
233 int idx = simianGridCredential.IndexOf(':');
234 string finalhash = simianGridCredential.Substring(0, idx);
235 string salt = simianGridCredential.Substring(idx + 1);
236
237 if (finalhash == Utils.MD5String(password + ":" + salt))
238 {
239 authorizeResult = Authorize(userID);
240 return true;
241 }
242 else
243 {
244 m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID +
245 " using md5hash " + Utils.MD5String(password) + ":" + salt);
246 }
247 }
248 else
249 {
250 // Unsalted version
251 if (password == simianGridCredential ||
252 "$1$" + password == simianGridCredential ||
253 "$1$" + Utils.MD5String(password) == simianGridCredential ||
254 Utils.MD5String(password) == simianGridCredential)
255 {
256 authorizeResult = Authorize(userID);
257 return true;
258 }
259 else
260 {
261 m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID +
262 " using md5hash $1$" + Utils.MD5String(password));
263 }
264 }
265
266 authorizeResult = null;
267 return false;
268 }
269
231 private string Authorize(UUID userID) 270 private string Authorize(UUID userID)
232 { 271 {
233 NameValueCollection requestArgs = new NameValueCollection 272 NameValueCollection requestArgs = new NameValueCollection
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 874f1a2..56c73ec 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 748faef..0947b5f 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -483,7 +483,7 @@ namespace OpenSim.Services.Connectors.Simulation
483 } 483 }
484 catch (WebException ex) 484 catch (WebException ex)
485 { 485 {
486 m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete {0}", ex.Message); 486 m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message);
487 return false; 487 return false;
488 } 488 }
489 finally 489 finally
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 7c98642..225530f 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -273,14 +273,15 @@ namespace OpenSim.Services.GridService
273 if (region != null) 273 if (region != null)
274 { 274 {
275 // Not really? Maybe? 275 // Not really? Maybe?
276 List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize, 276 List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1,
277 region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID); 277 region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
278 278
279 foreach (RegionData rdata in rdatas) 279 foreach (RegionData rdata in rdatas)
280 if (rdata.RegionID != regionID) 280 if (rdata.RegionID != regionID)
281 rinfos.Add(RegionData2RegionInfo(rdata)); 281 rinfos.Add(RegionData2RegionInfo(rdata));
282 282
283 } 283 }
284 m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count);
284 return rinfos; 285 return rinfos;
285 } 286 }
286 287
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index 09d1d87..c580078 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -29,6 +29,8 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenMetaverse; 30using OpenMetaverse;
31 31
32using OpenSim.Framework;
33
32namespace OpenSim.Services.Interfaces 34namespace OpenSim.Services.Interfaces
33{ 35{
34 public class UserAccount 36 public class UserAccount
@@ -50,7 +52,7 @@ namespace OpenSim.Services.Interfaces
50 LastName = lastName; 52 LastName = lastName;
51 Email = email; 53 Email = email;
52 ServiceURLs = new Dictionary<string, object>(); 54 ServiceURLs = new Dictionary<string, object>();
53 // Created = ??? 55 Created = Util.UnixTimeSinceEpoch();
54 } 56 }
55 57
56 public string FirstName; 58 public string FirstName;
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 063251a..326e502 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -357,7 +357,7 @@ namespace OpenSim.Services.UserAccountService
357 /// <param name="lastName"></param> 357 /// <param name="lastName"></param>
358 /// <param name="password"></param> 358 /// <param name="password"></param>
359 /// <param name="email"></param> 359 /// <param name="email"></param>
360 public void CreateUser(string firstName, string lastName, string password, string email) 360 private void CreateUser(string firstName, string lastName, string password, string email)
361 { 361 {
362 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); 362 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
363 if (null == account) 363 if (null == account)
@@ -374,12 +374,14 @@ namespace OpenSim.Services.UserAccountService
374 374
375 if (StoreUserAccount(account)) 375 if (StoreUserAccount(account))
376 { 376 {
377 bool success = false; 377 bool success;
378 if (m_AuthenticationService != null) 378 if (m_AuthenticationService != null)
379 {
379 success = m_AuthenticationService.SetPassword(account.PrincipalID, password); 380 success = m_AuthenticationService.SetPassword(account.PrincipalID, password);
380 if (!success) 381 if (!success)
381 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.", 382 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
382 firstName, lastName); 383 firstName, lastName);
384 }
383 385
384 GridRegion home = null; 386 GridRegion home = null;
385 if (m_GridService != null) 387 if (m_GridService != null)
@@ -399,18 +401,22 @@ namespace OpenSim.Services.UserAccountService
399 firstName, lastName); 401 firstName, lastName);
400 402
401 if (m_InventoryService != null) 403 if (m_InventoryService != null)
404 {
402 success = m_InventoryService.CreateUserInventory(account.PrincipalID); 405 success = m_InventoryService.CreateUserInventory(account.PrincipalID);
403 if (!success) 406 if (!success)
404 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", 407 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
405 firstName, lastName); 408 firstName, lastName);
409 }
406 410
407 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName); 411 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName);
412 } else {
413 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Account creation failed for account {0} {1}", firstName, lastName);
408 } 414 }
409 } 415 }
410 else 416 else
411 { 417 {
412 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); 418 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName);
413 } 419 }
414 } 420 }
415 } 421 }
416} 422}