First attempt at fixing mantis #4641. It's better but there are now some issues with permissions.

(looks like my commit is going to touch CM files, I'm going to let it do it - eof only)
slimupdates
Diva Canto 2010-03-31 21:30:44 -07:00
parent 21519d3311
commit 08ba34da03
6 changed files with 38 additions and 18 deletions

View File

@ -139,6 +139,9 @@ namespace OpenSim.Framework.Communications.Osp
/// </returns>
protected static UUID ResolveOspaName(string name, IUserAccountService userService)
{
if (userService == null)
return UUID.Zero;
int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR);
if (nameSeparatorIndex < 0)
@ -149,7 +152,7 @@ namespace OpenSim.Framework.Communications.Osp
string firstName = name.Remove(nameSeparatorIndex).TrimEnd();
string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart();
UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName);
if (account != null)
return account.PrincipalID;

View File

@ -38,7 +38,7 @@ using OpenSim.Framework.Console;
namespace OpenSim.Framework
{
{
public class RegionLightShareData : ICloneable
{
public UUID regionID = UUID.Zero;
@ -86,11 +86,11 @@ namespace OpenSim.Framework
{
if (OnSave != null)
OnSave(this);
}
public object Clone()
{
return this.MemberwiseClone(); // call clone method
}
}
public object Clone()
{
return this.MemberwiseClone(); // call clone method
}
}

View File

@ -173,11 +173,11 @@ namespace OpenSim.Region.CoreModules.Framework.Library
m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName);
simpleName = GetInventoryPathFromName(simpleName);
InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName);
try
{
InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName);
List<InventoryNodeBase> nodes = archread.Execute();
if (nodes.Count == 0)
if (nodes != null && nodes.Count == 0)
{
// didn't find the subfolder with the given name; place it on the top
m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName);
@ -185,16 +185,33 @@ namespace OpenSim.Region.CoreModules.Framework.Library
archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName);
archread.Execute();
}
archread.Close();
foreach (InventoryNodeBase node in nodes)
FixPerms(node);
}
catch (Exception e)
{
m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.Message);
m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.StackTrace);
}
finally
{
archread.Close();
}
}
}
private void FixPerms(InventoryNodeBase node)
{
if (node is InventoryItemBase)
{
InventoryItemBase item = (InventoryItemBase)node;
item.BasePermissions = 0x7FFFFFFF;
item.EveryOnePermissions = 0x7FFFFFFF;
item.CurrentPermissions = 0x7FFFFFFF;
item.NextPermissions = 0x7FFFFFFF;
}
}
private void DumpLibrary()
{
InventoryFolderImpl lib = m_Library.LibraryRootFolder;

View File

@ -42,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
{
// Windlight Functions
LSL_List cmGetWindlightScene(LSL_List rules);
int cmSetWindlightScene(LSL_List rules);
int cmSetWindlightScene(LSL_List rules);
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
}
}

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int WL_CLOUD_SCROLL_Y = 32;
public const int WL_CLOUD_SCROLL_Y_LOCK = 33;
public const int WL_CLOUD_SCROLL_X_LOCK = 34;
public const int WL_DRAW_CLASSIC_CLOUDS = 35;
public const int WL_DRAW_CLASSIC_CLOUDS = 35;
public const int WL_SUN_MOON_POSITION = 36;
}

View File

@ -66,11 +66,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public int cmSetWindlightScene(LSL_List rules)
{
return m_CM_Functions.cmSetWindlightScene(rules);
}
public int cmSetWindlightSceneTargeted(LSL_List rules, key target)
{
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
}
public int cmSetWindlightSceneTargeted(LSL_List rules, key target)
{
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
}
}
}