Fix perms when linking an object. Set root part perms to the perms

of the link set to make the build floater behave consistently.
Fixes permissions exploit introduced on 23 August.
avinationmerge
Melanie 2012-10-14 17:32:46 +02:00
parent ce26730d4e
commit aba078c93f
5 changed files with 28 additions and 13 deletions

View File

@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
//m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
SendGridInstantMessageViaXMLRPC(im, result);
}

View File

@ -2503,6 +2503,12 @@ namespace OpenSim.Region.Framework.Scenes
}
m_sceneGraph.LinkObjects(root, children);
ScenePresence sp;
if (TryGetScenePresence(agentId, out sp))
{
root.SendPropertiesToClient(sp.ControllingClient);
}
}
private string PermissionString(uint permissions)

View File

@ -1849,6 +1849,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup;
}
parentGroup.AdjustChildPrimPermissions();
parentGroup.HasGroupChanged = true;
parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);
parentGroup.ScheduleGroupForFullUpdate();
@ -1989,6 +1990,7 @@ namespace OpenSim.Region.Framework.Scenes
// return unless the root is deleted. This will remove them
// from the database. They will be rewritten immediately,
// minus the rows for the unlinked child prims.
g.AdjustChildPrimPermissions();
m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID);
g.TriggerScriptChangedEvent(Changed.LINK);
g.HasGroupChanged = true; // Persist

View File

@ -3410,11 +3410,18 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions()
{
uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
uint foldedPerms = RootPart.OwnerMask & 3;
ForEachPart(part =>
{
newOwnerMask &= part.BaseMask;
if (part != RootPart)
part.ClonePermissions(RootPart);
});
RootPart.OwnerMask = newOwnerMask | foldedPerms;
RootPart.ScheduleFullUpdate();
}
public void UpdatePermissions(UUID AgentID, byte field, uint localID,

View File

@ -4497,20 +4497,20 @@ namespace OpenSim.Region.Framework.Scenes
{
bool update = false;
if (BaseMask != source.BaseMask ||
OwnerMask != source.OwnerMask ||
GroupMask != source.GroupMask ||
EveryoneMask != source.EveryoneMask ||
NextOwnerMask != source.NextOwnerMask)
update = true;
uint prevOwnerMask = OwnerMask;
uint prevGroupMask = GroupMask;
uint prevEveryoneMask = EveryoneMask;
uint prevNextOwnerMask = NextOwnerMask;
BaseMask = source.BaseMask;
OwnerMask = source.OwnerMask;
GroupMask = source.GroupMask;
EveryoneMask = source.EveryoneMask;
NextOwnerMask = source.NextOwnerMask;
OwnerMask = source.OwnerMask & BaseMask;
GroupMask = source.GroupMask & BaseMask;
EveryoneMask = source.EveryoneMask & BaseMask;
NextOwnerMask = source.NextOwnerMask & BaseMask;
if (update)
if (OwnerMask != prevOwnerMask ||
GroupMask != prevGroupMask ||
EveryoneMask != prevEveryoneMask ||
NextOwnerMask != prevNextOwnerMask)
SendFullUpdateToAllClients();
}