From 08ba34da0325e3ed2a839cff62f2020742e887e7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 31 Mar 2010 21:30:44 -0700 Subject: 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) --- .../CoreModules/Framework/Library/LibraryModule.cs | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework/Library') diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index e37da9f..36dae6b 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -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 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; -- cgit v1.1