aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorMelanie2013-07-04 22:32:58 +0100
committerMelanie2013-07-04 22:32:58 +0100
commit5ddcc25ee9de481c40a26aabc57d77c71225162e (patch)
tree298768abaca492365ac1c9786b0d4ce7dae934ab /OpenSim/Region/CoreModules/Framework
parentMerge branch 'master' into careminster (diff)
parentGuard against completely unknown user UUIDs. (diff)
downloadopensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.zip
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.gz
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.bz2
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs9
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs42
3 files changed, 48 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 7871eda..144895c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -73,6 +73,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
73 73
74 private AssetMetadata FetchMetadata(string url, UUID assetID) 74 private AssetMetadata FetchMetadata(string url, UUID assetID)
75 { 75 {
76 if (string.IsNullOrEmpty(url))
77 return null;
78
76 if (!url.EndsWith("/") && !url.EndsWith("=")) 79 if (!url.EndsWith("/") && !url.EndsWith("="))
77 url = url + "/"; 80 url = url + "/";
78 81
@@ -92,6 +95,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
92 AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); 95 AssetBase asset = m_scene.AssetService.Get(assetID.ToString());
93 if (asset == null) 96 if (asset == null)
94 { 97 {
98 if (string.IsNullOrEmpty(url))
99 return null;
100
95 if (!url.EndsWith("/") && !url.EndsWith("=")) 101 if (!url.EndsWith("/") && !url.EndsWith("="))
96 url = url + "/"; 102 url = url + "/";
97 103
@@ -109,6 +115,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
109 115
110 public bool PostAsset(string url, AssetBase asset) 116 public bool PostAsset(string url, AssetBase asset)
111 { 117 {
118 if (string.IsNullOrEmpty(url))
119 return false;
120
112 if (asset != null) 121 if (asset != null)
113 { 122 {
114 if (!url.EndsWith("/") && !url.EndsWith("=")) 123 if (!url.EndsWith("/") && !url.EndsWith("="))
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index b2b628d..1eae0ac 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
244 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 244 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
245 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 245 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
246 { 246 {
247 m_log.DebugFormat("[HGScene] RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID); 247 m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
248 248
249 //if (fromTaskID.Equals(UUID.Zero)) 249 //if (fromTaskID.Equals(UUID.Zero))
250 //{ 250 //{
@@ -297,7 +297,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
297 if (m_Scene.TryGetScenePresence(userID, out sp)) 297 if (m_Scene.TryGetScenePresence(userID, out sp))
298 { 298 {
299 AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 299 AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
300 if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) 300 if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
301 { 301 {
302 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString(); 302 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
303 assetServerURL = assetServerURL.Trim(new char[] { '/' }); 303 assetServerURL = assetServerURL.Trim(new char[] { '/' });
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 194b591..a7cbc8f 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -135,7 +135,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
135 s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); 135 s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); });
136 } 136 }
137 137
138
139 void EventManager_OnNewClient(IClientAPI client) 138 void EventManager_OnNewClient(IClientAPI client)
140 { 139 {
141 client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed); 140 client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed);
@@ -151,6 +150,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
151 150
152 void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) 151 void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client)
153 { 152 {
153// m_log.DebugFormat(
154// "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}",
155// uuid, remote_client.Name);
156
154 if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) 157 if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid))
155 { 158 {
156 remote_client.SendNameReply(uuid, "Mr", "OpenSim"); 159 remote_client.SendNameReply(uuid, "Mr", "OpenSim");
@@ -319,8 +322,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
319 } 322 }
320 else 323 else
321 { 324 {
325 // Let's try the GridUser service
326 GridUserInfo uInfo = m_Scenes[0].GridUserService.GetGridUserInfo(uuid.ToString());
327 if (uInfo != null)
328 {
329 string url, first, last, tmp;
330 UUID u;
331 if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out u, out url, out first, out last, out tmp))
332 {
333 AddUser(uuid, first, last, url);
334
335 if (m_UserCache.ContainsKey(uuid))
336 {
337 names[0] = m_UserCache[uuid].FirstName;
338 names[1] = m_UserCache[uuid].LastName;
339
340 return true;
341 }
342 }
343 else
344 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Unable to parse UUI {0}", uInfo.UserID);
345 }
346 else
347 {
348 m_log.DebugFormat("[USER MANAGEMENT MODULE]: No grid user found for {0}", uuid);
349 }
350
322 names[0] = "Unknown"; 351 names[0] = "Unknown";
323 names[1] = "UserUMMTGUN3"; 352 names[1] = "UserUMMTGUN7";
324 353
325 return false; 354 return false;
326 } 355 }
@@ -474,7 +503,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
474 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); 503 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
475 504
476 UserData oldUser; 505 UserData oldUser;
477 //lock the whole block - prevent concurrent update
478 lock (m_UserCache) 506 lock (m_UserCache)
479 m_UserCache.TryGetValue(id, out oldUser); 507 m_UserCache.TryGetValue(id, out oldUser);
480 508
@@ -512,7 +540,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
512 UserData user = new UserData(); 540 UserData user = new UserData();
513 user.Id = id; 541 user.Id = id;
514 542
515 if (creatorData != null && creatorData != string.Empty) 543 if (!string.IsNullOrEmpty(creatorData))
516 { 544 {
517 //creatorData = <endpoint>;<name> 545 //creatorData = <endpoint>;<name>
518 546
@@ -536,8 +564,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
536 } 564 }
537 else 565 else
538 { 566 {
567 // Temporarily add unknown user entries of this type into the cache so that we can distinguish
568 // this source from other recent (hopefully resolved) bugs that fail to retrieve a user name binding
569 // TODO: Can be removed when GUN* unknown users have definitely dropped significantly or
570 // disappeared.
539 user.FirstName = "Unknown"; 571 user.FirstName = "Unknown";
540 user.LastName = "UserUMMAU"; 572 user.LastName = "UserUMMAU3";
541 } 573 }
542 574
543 AddUserInternal(user); 575 AddUserInternal(user);