diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:58:19 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:21 +0100 |
commit | ee6cd884c9732b492675e043fe318ffcdfecc45d (patch) | |
tree | ce3343d85b54bb04a5182a4cd65355988075ad68 /OpenSim/Region/CoreModules | |
parent | factor out soon to be common media permissions check code (diff) | |
download | opensim-SC-ee6cd884c9732b492675e043fe318ffcdfecc45d.zip opensim-SC-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.gz opensim-SC-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.bz2 opensim-SC-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.xz |
implement serverside checks for media texture navigation in order to stop naughty clients
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 21 |
2 files changed, 34 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index d7aede9..09786ec 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -245,12 +245,12 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
245 | 245 | ||
246 | m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); | 246 | m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); |
247 | 247 | ||
248 | for (int i = 0; i < omu.FaceMedia.Length; i++) | 248 | // for (int i = 0; i < omu.FaceMedia.Length; i++) |
249 | { | 249 | // { |
250 | MediaEntry me = omu.FaceMedia[i]; | 250 | // MediaEntry me = omu.FaceMedia[i]; |
251 | string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); | 251 | // string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); |
252 | m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); | 252 | // m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); |
253 | } | 253 | // } |
254 | 254 | ||
255 | if (omu.FaceMedia.Length > part.GetNumberOfSides()) | 255 | if (omu.FaceMedia.Length > part.GetNumberOfSides()) |
256 | { | 256 | { |
@@ -322,6 +322,14 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
322 | return string.Empty; | 322 | return string.Empty; |
323 | } | 323 | } |
324 | 324 | ||
325 | UUID agentId = default(UUID); | ||
326 | |||
327 | lock (m_omuCapUsers) | ||
328 | agentId = m_omuCapUsers[path]; | ||
329 | |||
330 | if (!m_scene.Permissions.CanInteractWithPrimMedia(agentId, part.UUID, omn.Face)) | ||
331 | return string.Empty; | ||
332 | |||
325 | m_log.DebugFormat( | 333 | m_log.DebugFormat( |
326 | "[MOAP]: Updating media entry for face {0} on prim {1} {2} to {3}", | 334 | "[MOAP]: Updating media entry for face {0} on prim {1} {2} to {3}", |
327 | omn.Face, part.Name, part.UUID, omn.URL); | 335 | omn.Face, part.Name, part.UUID, omn.URL); |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 2344e96..3a690af 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -251,6 +251,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
251 | m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED | 251 | m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED |
252 | 252 | ||
253 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; | 253 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; |
254 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; | ||
254 | 255 | ||
255 | m_scene.AddCommand(this, "bypass permissions", | 256 | m_scene.AddCommand(this, "bypass permissions", |
256 | "bypass permissions <true / false>", | 257 | "bypass permissions <true / false>", |
@@ -1915,7 +1916,25 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1915 | return true; | 1916 | return true; |
1916 | 1917 | ||
1917 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); | 1918 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); |
1918 | } | 1919 | } |
1920 | |||
1921 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) | ||
1922 | { | ||
1923 | if (null == m_moapModule) | ||
1924 | return false; | ||
1925 | |||
1926 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); | ||
1927 | if (null == part) | ||
1928 | return false; | ||
1929 | |||
1930 | MediaEntry me = m_moapModule.GetMediaEntry(part, face); | ||
1931 | |||
1932 | // If there is no existing media entry then it can be controlled (in this context, created). | ||
1933 | if (null == me) | ||
1934 | return true; | ||
1935 | |||
1936 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); | ||
1937 | } | ||
1919 | 1938 | ||
1920 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) | 1939 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) |
1921 | { | 1940 | { |