mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -7078,32 +7078,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
taskID = new UUID(transfer.TransferInfo.Params, 48);
|
||||
UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
|
||||
UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
|
||||
// requestID, itemID, taskID, Name);
|
||||
|
||||
if (!(((Scene)m_scene).Permissions.BypassPermissions()))
|
||||
{
|
||||
if (taskID != UUID.Zero) // Prim
|
||||
{
|
||||
SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
|
||||
|
||||
if (part == null)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
|
||||
Name, requestID, itemID, taskID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (part.OwnerID != AgentId)
|
||||
return true;
|
||||
|
||||
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||
return true;
|
||||
|
||||
TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
|
||||
if (ti == null)
|
||||
return true;
|
||||
|
||||
if (ti.OwnerID != AgentId)
|
||||
return true;
|
||||
|
||||
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
|
||||
return true;
|
||||
|
||||
if (ti.AssetID != requestID)
|
||||
TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
|
||||
if (tii == null)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
|
||||
Name, requestID, itemID, taskID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tii.Type == (int)AssetType.LSLText)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
|
||||
return true;
|
||||
}
|
||||
else if (tii.Type == (int)AssetType.Notecard)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Change this code to allow items other than notecards and scripts to be successfully
|
||||
// shared with group. In fact, this whole block of permissions checking should move to an IPermissionsModule
|
||||
if (part.OwnerID != AgentId)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
|
||||
Name, requestID, itemID, taskID, part.OwnerID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
|
||||
Name, requestID, itemID, taskID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tii.OwnerID != AgentId)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
|
||||
Name, requestID, itemID, taskID, tii.OwnerID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((
|
||||
tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
|
||||
!= ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
|
||||
Name, requestID, itemID, taskID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tii.AssetID != requestID)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
|
||||
Name, requestID, itemID, taskID, tii.AssetID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Agent
|
||||
{
|
||||
@@ -7123,7 +7181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// only to notecards and scripts. All
|
||||
// other asset types are always available
|
||||
//
|
||||
if (assetRequestItem.AssetType == 10)
|
||||
if (assetRequestItem.AssetType == (int)AssetType.LSLText)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
|
||||
{
|
||||
@@ -7131,7 +7189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (assetRequestItem.AssetType == 7)
|
||||
else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
|
||||
{
|
||||
@@ -7141,7 +7199,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
if (assetRequestItem.AssetID != requestID)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
|
||||
Name, requestID, itemID, assetRequestItem.AssetID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11376,7 +11439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// }
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID);
|
||||
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
|
||||
|
||||
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
|
||||
}
|
||||
@@ -11744,4 +11807,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(dialog, ThrottleOutPacketType.Task);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user