mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
thanks lulurun for a security patch that blocks unathorized access to the inventory server (see http://opensimulator.org/wiki/Security_vulnerability_brought_by_non-check_inventory_service)
This commit is contained in:
@@ -59,6 +59,33 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
m_commsManager = commsManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A new user has moved into a region in this instance so retrieve their profile from the user service.
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
public void AddNewUser(IClientAPI remoteClient)
|
||||
{
|
||||
// Potential fix - Multithreading issue.
|
||||
lock (m_userProfiles)
|
||||
{
|
||||
if (!m_userProfiles.ContainsKey(remoteClient.AgentId))
|
||||
{
|
||||
UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(remoteClient.AgentId);
|
||||
CachedUserInfo userInfo = new CachedUserInfo(m_commsManager, userProfile, remoteClient);
|
||||
|
||||
if (userInfo.UserProfile != null)
|
||||
{
|
||||
// The inventory for the user will be populated when they actually enter the scene
|
||||
m_userProfiles.Add(remoteClient.AgentId, userInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[USER CACHE]: User profile for user {0} not found.", remoteClient.AgentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A new user has moved into a region in this instance so retrieve their profile from the user service.
|
||||
/// </summary>
|
||||
@@ -119,7 +146,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
CachedUserInfo userInfo = GetUserDetails(userID);
|
||||
if (userInfo != null)
|
||||
{
|
||||
m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
|
||||
m_commsManager.SecureInventoryService.RequestInventoryForUser(userID, userInfo.SessionID, userInfo.InventoryReceive);
|
||||
//IInventoryServices invService = userInfo.GetInventoryService();
|
||||
//if (invService != null)
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user