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)

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;