From 321bde8a3afc7cba63e008d8aa2a3adc733031c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Jan 2014 22:20:42 +0100 Subject: Minor: Add prentheses to make a condition clearer --- OpenSim/Services/GridService/GridService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index daebf8b..7f71835 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -283,7 +283,7 @@ namespace OpenSim.Services.GridService int flags = Convert.ToInt32(region.Data["flags"]); - if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) + if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0)) { flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; region.Data["flags"] = flags.ToString(); @@ -298,7 +298,6 @@ namespace OpenSim.Services.GridService } return true; - } return m_Database.Delete(regionID); -- cgit v1.1 From c0cdc6b74f634da9fc79691a7965b0648cbcf800 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 18 Mar 2014 02:16:00 +0100 Subject: Add delete maptile ability to MapImageService - yet untested --- .../MapImage/MapImageServicesConnector.cs | 60 ++++++++++++++++++++++ OpenSim/Services/Interfaces/IMapImageService.cs | 1 + .../Services/MapImageService/MapImageService.cs | 33 +++++++++++- 3 files changed, 92 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 30bfb70..267dd71 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs @@ -86,6 +86,66 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI.TrimEnd('/'); } + public bool RemoveMapTile(int x, int y, out string reason) + { + reason = string.Empty; + int tickstart = Util.EnvironmentTickCount(); + Dictionary sendData = new Dictionary(); + sendData["X"] = x.ToString(); + sendData["Y"] = y.ToString(); + + string reqString = ServerUtils.BuildQueryString(sendData); + string uri = m_ServerURI + "/removemap"; + + try + { + string reply = SynchronousRestFormsRequester.MakeRequest("POST", + uri, + reqString); + if (reply != string.Empty) + { + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "success")) + { + return true; + } + else if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "failure")) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Delete failed: {0}", replyData["Message"].ToString()); + reason = replyData["Message"].ToString(); + return false; + } + else if (!replyData.ContainsKey("Result")) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: reply data does not contain result field"); + } + else + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); + reason = "Unexpected result " + replyData["Result"].ToString(); + } + + } + else + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply"); + } + } + catch (Exception e) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting map server at {0}: {1}", uri, e.Message); + } + finally + { + // This just dumps a warning for any operation that takes more than 100 ms + int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile deleted in {0}ms", tickdiff); + } + + return false; + } + public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) { reason = string.Empty; diff --git a/OpenSim/Services/Interfaces/IMapImageService.cs b/OpenSim/Services/Interfaces/IMapImageService.cs index a7b2cf1..78daa5f 100644 --- a/OpenSim/Services/Interfaces/IMapImageService.cs +++ b/OpenSim/Services/Interfaces/IMapImageService.cs @@ -35,6 +35,7 @@ namespace OpenSim.Services.Interfaces { //List GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY); bool AddMapTile(int x, int y, byte[] imageData, out string reason); + bool RemoveMapTile(int x, int y, out string reason); byte[] GetMapTile(string fileName, out string format); } } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index a85ee70..e2f256f 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -112,9 +112,38 @@ namespace OpenSim.Services.MapImageService reason = e.Message; return false; } + } + + return UpdateMultiResolutionFiles(x, y, out reason); + } + + public bool RemoveMapTile(int x, int y, out string reason) + { + reason = String.Empty; + string fileName = GetFileName(1, x, y); + + lock (m_Sync) + { + try + { + File.Delete(fileName); + } + catch (Exception e) + { + m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); + reason = e.Message; + return false; + } + } - // Also save in png format? + return UpdateMultiResolutionFiles(x, y, out reason); + } + private bool UpdateMultiResolutionFiles(int x, int y, out string reason) + { + reason = String.Empty; + lock (m_Sync) + { // Stitch seven more aggregate tiles together for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) { @@ -126,7 +155,7 @@ namespace OpenSim.Services.MapImageService if (!CreateTile(zoomLevel, x1, y1)) { - m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0} at zoom level {1}", fileName, zoomLevel); + m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); return false; } -- cgit v1.1 From 17aeec88602509a9628ba3ba06dc2fed6ef4af63 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 25 Mar 2014 03:16:37 +0100 Subject: Reinstate the timed region change signal --- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index a5f5749..834fd77 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -96,6 +96,10 @@ namespace OpenSim.Region.CoreModules.World.Estate m_commands = new EstateManagementCommands(this); m_commands.Initialise(); + + m_regionChangeTimer.Interval = 10000; + m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; + m_regionChangeTimer.AutoReset = false; } public void RemoveRegion(Scene scene) {} -- cgit v1.1 From 075cf2baa3eeb43c6a54921cd2a8489b3ca35d37 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 25 Mar 2014 03:17:04 +0100 Subject: Remove the spammy "voice not enabled" message some viewers trigger in non voice parcels --- .../OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index e756c70..9e6cc1a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -635,15 +635,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // TODO: EstateSettings don't seem to get propagated... if (!scene.RegionInfo.EstateSettings.AllowVoice) { - m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", - scene.RegionInfo.RegionName); + //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", + // scene.RegionInfo.RegionName); channel_uri = String.Empty; } if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) { - m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", - scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); + //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", + // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); channel_uri = String.Empty; } else -- cgit v1.1 From a30ad71651cb49720bf8b04e2d651bd28f5b8ea2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 25 Mar 2014 03:17:44 +0100 Subject: Guard against Scene being null in attachments it the wearing avatar is in the process of logging out. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3e1dcaa..86f60bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1886,25 +1886,27 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectPart part = parts[i]; - Scene.ForEachRootScenePresence(delegate(ScenePresence avatar) + if (Scene != null) { - if (avatar.ParentID == LocalId) - avatar.StandUp(); - - if (!silent) + Scene.ForEachRootScenePresence(delegate(ScenePresence avatar) { - part.ClearUpdateSchedule(); - if (part == m_rootPart) + if (avatar.ParentID == LocalId) + avatar.StandUp(); + + if (!silent) { - if (!IsAttachment - || AttachedAvatar == avatar.ControllingClient.AgentId - || !HasPrivateAttachmentPoint) - avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId }); + part.ClearUpdateSchedule(); + if (part == m_rootPart) + { + if (!IsAttachment + || AttachedAvatar == avatar.ControllingClient.AgentId + || !HasPrivateAttachmentPoint) + avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId }); + } } - } - }); + }); + } } - } public void AddScriptLPS(int count) -- cgit v1.1 From bb841ea9cefb937c548646d366f689ef3bb80c61 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 6 Apr 2014 23:22:37 +0200 Subject: Change OfflineMessageModule to support more differentiated return values and allow support for mobile devices and other non-viewer logins --- .../Avatar/InstantMessage/OfflineMessageModule.cs | 55 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 2d46276..41958b3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -40,6 +40,13 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { + public struct SendReply + { + public bool Success; + public string Message; + public int Disposition; + } + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "OfflineMessageModule")] public class OfflineMessageModule : ISharedRegionModule { @@ -50,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private string m_RestURL = String.Empty; IMessageTransferModule m_TransferModule = null; private bool m_ForwardOfflineGroupMessages = true; + private Dictionary> m_repliesSent= new Dictionary>(); public void Initialise(IConfigSource config) { @@ -169,6 +177,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void OnNewClient(IClientAPI client) { client.OnRetrieveInstantMessages += RetrieveInstantMessages; + client.OnLogout += OnClientLoggedOut; + } + + public void OnClientLoggedOut(IClientAPI client) + { + m_repliesSent.Remove(client); } private void RetrieveInstantMessages(IClientAPI client) @@ -228,7 +242,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage if (scene == null) scene = m_SceneList[0]; - bool success = SynchronousRestObjectRequester.MakeRequest( + SendReply reply = SynchronousRestObjectRequester.MakeRequest( "POST", m_RestURL+"/SaveMessage/?scope=" + scene.RegionInfo.ScopeID.ToString(), im); @@ -238,13 +252,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage if (client == null) return; - client.SendInstantMessage(new GridInstantMessage( - null, new UUID(im.toAgentID), - "System", new UUID(im.fromAgentID), - (byte)InstantMessageDialog.MessageFromAgent, - "User is not logged in. "+ - (success ? "Message saved." : "Message not saved"), - false, new Vector3())); + if (reply.Message == String.Empty) + reply.Message = "User is not logged in. " + (reply.Success ? "Message saved." : "Message not saved"); + + bool sendReply = true; + + switch (reply.Disposition) + { + case 0: // Normal + break; + case 1: // Only once per user + if (m_repliesSent.ContainsKey(client) && m_repliesSent[client].Contains(new UUID(im.toAgentID))) + { + sendReply = false; + } + else + { + if (!m_repliesSent.ContainsKey(client)) + m_repliesSent[client] = new List(); + m_repliesSent[client].Add(new UUID(im.toAgentID)); + } + break; + } + + if (sendReply) + { + client.SendInstantMessage(new GridInstantMessage( + null, new UUID(im.toAgentID), + "System", new UUID(im.fromAgentID), + (byte)InstantMessageDialog.MessageFromAgent, + reply.Message, + false, new Vector3())); + } } } } -- cgit v1.1 From f93dac9239dc71020f143339997b3b7abc15f69d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 20 Apr 2014 10:47:31 +0200 Subject: Implement Oren's fix to prevent a privilege escalation with groups --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f4ea975..7c62f90 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2233,9 +2233,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { - m_activeGroupID = activegroupid; - m_activeGroupName = groupname; - m_activeGroupPowers = grouppowers; + if (agentid == AgentId) + { + m_activeGroupID = activegroupid; + m_activeGroupName = groupname; + m_activeGroupPowers = grouppowers; + } AgentDataUpdatePacket sendAgentDataUpdate = (AgentDataUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentDataUpdate); sendAgentDataUpdate.AgentData.ActiveGroupID = activegroupid; -- cgit v1.1 From fb321a05736c7ba4516f2f69ec04190b10925df5 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Wed, 23 Apr 2014 12:58:31 -0400 Subject: Prevent sending Land Properties for unprivileged users --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 07d00c0..4ea1739 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using log4net; using OpenMetaverse; @@ -389,12 +390,14 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.DenyAgeUnverified); } - uint preserve = LandData.Flags & ~allowedDelta; - newData.Flags = preserve | (args.ParcelFlags & allowedDelta); - - m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); + if (allowedDelta != 0) + { + uint preserve = LandData.Flags & ~allowedDelta; + newData.Flags = preserve | (args.ParcelFlags & allowedDelta); - SendLandUpdateToAvatarsOverMe(snap_selection); + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); + SendLandUpdateToAvatarsOverMe(snap_selection); + } } public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) -- cgit v1.1 From c77cd6adc78164e0e43e6c65d77162e348346241 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 23 Apr 2014 19:55:51 +0100 Subject: minor: Remove unused System.Linq reference and use ParcelFlags.None instead of 0 from previous commit cb1f28 --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 4ea1739..7325e48 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; using log4net; using OpenMetaverse; @@ -390,7 +389,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.DenyAgeUnverified); } - if (allowedDelta != 0) + if (allowedDelta != (uint)ParcelFlags.None) { uint preserve = LandData.Flags & ~allowedDelta; newData.Flags = preserve | (args.ParcelFlags & allowedDelta); -- cgit v1.1 From 5c661baf6c197caef73e6a8fe5a2223d00a2a6ba Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 26 Apr 2014 02:42:30 +0200 Subject: Allow opening a https port using only http so that nginx can be used for ssl --- OpenSim/Framework/NetworkServersInfo.cs | 2 ++ .../Region/ClientStack/RegionApplicationBase.cs | 26 +++++++++++++----- OpenSim/Server/Base/HttpServerBase.cs | 32 ++++++++++++++-------- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index 4b7d4c7..dfe9695 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -41,6 +41,7 @@ namespace OpenSim.Framework // "Out of band" managemnt https public bool ssl_listener = false; + public bool ssl_external = false; public uint https_port = 0; public string cert_path = String.Empty; public string cert_pass = String.Empty; @@ -64,6 +65,7 @@ namespace OpenSim.Framework // "Out of band management https" ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false); + ssl_external = config.Configs["Network"].GetBoolean("https_external",false); if( ssl_listener) { cert_path = config.Configs["Network"].GetString("cert_path",String.Empty); diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 853b72d..287c278 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -100,13 +100,25 @@ namespace OpenSim.Region.ClientStack // "OOB" Server if (m_networkServersInfo.ssl_listener) { - BaseHttpServer server = new BaseHttpServer( - m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, - m_networkServersInfo.cert_pass); + if (!m_networkServersInfo.ssl_external) + { + BaseHttpServer server = new BaseHttpServer( + m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, + m_networkServersInfo.cert_pass); - m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); - MainServer.AddHttpServer(server); - server.Start(); + m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); + MainServer.AddHttpServer(server); + server.Start(); + } + else + { + BaseHttpServer server = new BaseHttpServer( + m_networkServersInfo.https_port); + + m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); + MainServer.AddHttpServer(server); + server.Start(); + } } base.StartupSpecific(); @@ -132,4 +144,4 @@ namespace OpenSim.Region.ClientStack return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier); } } -} \ No newline at end of file +} diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index 954783c..eed2645 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs @@ -40,7 +40,7 @@ namespace OpenSim.Server.Base { public class HttpServerBase : ServicesServerBase { -// private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private uint m_consolePort; @@ -69,6 +69,7 @@ namespace OpenSim.Server.Base bool ssl_main = networkConfig.GetBoolean("https_main",false); bool ssl_listener = networkConfig.GetBoolean("https_listener",false); + bool ssl_external = networkConfig.GetBoolean("https_external",false); m_consolePort = (uint)networkConfig.GetInt("ConsolePort", 0); @@ -113,20 +114,29 @@ namespace OpenSim.Server.Base uint https_port = (uint)networkConfig.GetInt("https_port", 0); - string cert_path = networkConfig.GetString("cert_path",String.Empty); - if ( cert_path == String.Empty ) + m_log.WarnFormat("[SSL]: External flag is {0}", ssl_external); + if (!ssl_external) { - System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + string cert_path = networkConfig.GetString("cert_path",String.Empty); + if ( cert_path == String.Empty ) + { + System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); + Thread.CurrentThread.Abort(); + } + string cert_pass = networkConfig.GetString("cert_pass",String.Empty); + if ( cert_pass == String.Empty ) + { + System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); + Thread.CurrentThread.Abort(); + } + + MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass)); } - string cert_pass = networkConfig.GetString("cert_pass",String.Empty); - if ( cert_pass == String.Empty ) + else { - System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + m_log.WarnFormat("[SSL]: SSL port is active but no SSL is used because external SSL was requested."); + MainServer.AddHttpServer(new BaseHttpServer(https_port)); } - - MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass)); } } -- cgit v1.1 From 1d1e444aed5f9eb3a77092f01f1f4d4ed3e18d11 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 26 Apr 2014 02:43:13 +0200 Subject: Convert region loading to new format --- OpenSim/Framework/RegionInfo.cs | 10 ++++++---- OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 6dde62f..24ec181 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -224,10 +224,12 @@ namespace OpenSim.Framework // public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig, IConfigSource configSource) { - // m_configSource = configSource; - configMember = - new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); - configMember.performConfigurationRetrieve(); + XmlElement elem = (XmlElement)xmlNode; + string name = elem.GetAttribute("Name"); + string xmlstr = "" + xmlNode.OuterXml + ""; + XmlConfigSource source = new XmlConfigSource(XmlReader.Create(new StringReader(xmlstr))); + ReadNiniConfig(source, name); + m_serverURI = string.Empty; } diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index c7caf6f..65de563 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs @@ -93,8 +93,8 @@ namespace OpenSim.Framework.RegionLoader.Web xmlSource.Length); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlSource); - if (xmlDoc.FirstChild.Name == "Regions") - { + if (xmlDoc.FirstChild.Name == "Nini") + { regionCount = xmlDoc.FirstChild.ChildNodes.Count; if (regionCount > 0) -- cgit v1.1 From d97896d39a50cdcbf1d96a9a9382b4dde7b76b53 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 26 Apr 2014 20:32:27 +0200 Subject: Differentiate between requests only the owner should be able to do and those that managers can do when setting parcel data --- .../CoreModules/World/Land/LandManagementModule.cs | 12 ++++++------ .../Region/CoreModules/World/Land/LandObject.cs | 22 +++++++++++----------- .../World/Permissions/PermissionsModule.cs | 2 +- .../Region/Framework/Scenes/Scene.Permissions.cs | 6 +++--- .../RegionCombinerPermissionModule.cs | 4 ++-- .../Shared/Api/Implementation/LSL_Api.cs | 10 +++++----- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index c307998..4e21724 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -565,7 +565,7 @@ namespace OpenSim.Region.CoreModules.World.Land requiredPowers = GroupPowers.LandManageBanned; if (m_scene.Permissions.CanEditParcelProperties(agentID, - land, requiredPowers)) + land, requiredPowers, false)) { land.UpdateAccessList(flags, transactionID, sequenceID, sections, entries, remote_client); @@ -927,7 +927,7 @@ namespace OpenSim.Region.CoreModules.World.Land //If we are still here, then they are subdividing within one piece of land //Check owner - if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin)) + if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin, true)) { return; } @@ -996,7 +996,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return; } - if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin)) + if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true)) { return; } @@ -1727,7 +1727,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land == null) return; - if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions)) + if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions, false)) return; land.LandData.OtherCleanTime = otherCleanTime; @@ -1827,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (targetAvatar.UserLevel == 0) { ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); - if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze)) + if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) return; if (flags == 0) { @@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.World.Land // Check if you even have permission to do this ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); - if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) && + if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true) && !m_scene.Permissions.IsAdministrator(client.AgentId)) return; diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 7325e48..2eafd44 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -286,7 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Land // ParcelFlags.ForSaleObjects // ParcelFlags.LindenHome - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, false)) { allowedDelta |= (uint)(ParcelFlags.AllowLandmark | ParcelFlags.AllowTerraform | @@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.AllowFly); } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale, true)) { if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) @@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.Land allowedDelta |= (uint)ParcelFlags.ForSale; } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces, false)) { newData.Category = args.Category; @@ -333,21 +333,21 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.MaturePublish) | (uint)(1 << 23); } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity, false)) { newData.Description = args.Desc; newData.Name = args.Name; newData.SnapshotID = args.SnapshotID; } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint, false)) { newData.LandingType = args.LandingType; newData.UserLocation = args.UserLocation; newData.UserLookAt = args.UserLookAt; } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia, false)) { newData.MediaAutoScale = args.MediaAutoScale; newData.MediaID = args.MediaID; @@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.UseEstateVoiceChan); } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false)) { newData.PassHours = args.PassHours; newData.PassPrice = args.PassPrice; @@ -376,13 +376,13 @@ namespace OpenSim.Region.CoreModules.World.Land allowedDelta |= (uint)ParcelFlags.UsePassList; } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed, false)) { allowedDelta |= (uint)(ParcelFlags.UseAccessGroup | ParcelFlags.UseAccessList); } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned, false)) { allowedDelta |= (uint)(ParcelFlags.UseBanList | ParcelFlags.DenyAnonymous | @@ -952,7 +952,7 @@ namespace OpenSim.Region.CoreModules.World.Land public void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client) { - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true)) { List resultLocalIDs = new List(); try @@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// public void SendLandObjectOwners(IClientAPI remote_client) { - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true)) { Dictionary primCount = new Dictionary(); List groups = new List(); diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 26e9131..4f5b9b7 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1047,7 +1047,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return GenericObjectPermission(editorID, objectID, false); } - private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene) + private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 535d87a..4d90726 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene); public delegate bool IsAdministratorHandler(UUID user); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); - public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); + public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); @@ -763,7 +763,7 @@ namespace OpenSim.Region.Framework.Scenes #region EDIT PARCEL - public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p) + public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, bool allowManager) { EditParcelPropertiesHandler handler = OnEditParcelProperties; if (handler != null) @@ -771,7 +771,7 @@ namespace OpenSim.Region.Framework.Scenes Delegate[] list = handler.GetInvocationList(); foreach (EditParcelPropertiesHandler h in list) { - if (h(user, parcel, p, m_scene) == false) + if (h(user, parcel, p, m_scene, allowManager) == false) return false; } } diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs index 7c662c9..40ed3fd 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs @@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule return m_rootScene.Permissions.CanEditObject(objectid, editorid); } - public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene) + public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene, bool allowManager) { - return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g); + return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g, allowManager); } public bool CanInstantMessage(UUID user, UUID target, Scene startscene) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e8502ac..3f0af6d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7106,7 +7106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) { int expires = 0; if (hours != 0) @@ -10431,7 +10431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // according to the docs, this command only works if script owner and land owner are the same // lets add estate owners and gods, too, and use the generic permission check. ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return; + if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia, false)) return; bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? byte loop = 0; @@ -10874,7 +10874,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) { int expires = 0; if (hours != 0) @@ -10915,7 +10915,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed, false)) { if (UUID.TryParse(avatar, out key)) { @@ -10942,7 +10942,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) { if (UUID.TryParse(avatar, out key)) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f4e4f44..9c148d1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1434,7 +1434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions)) + if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions, false)) { OSSLShoutError("You do not have permission to modify the parcel"); return; -- cgit v1.1