diff -Naur opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs --- opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs 2013-02-08 23:43:42.000000000 +0200 +++ opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs 2013-02-15 17:55:50.000000000 +0200 @@ -114,20 +114,19 @@ scene.AddCommand( "Archiving", this, "load iar", - "load iar [-m|--merge] []", + "load iar [-m|--merge] []", "Load user inventory archive (IAR).", "-m|--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" + " is user's first name." + Environment.NewLine + " is user's last name." + Environment.NewLine + " is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine - + " is the user's password." + Environment.NewLine + " is the filesystem path or URI from which to load the IAR." + string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME), HandleLoadInvConsoleCommand); scene.AddCommand( "Archiving", this, "save iar", - "save iar [-h|--home=] [--noassets] [] [-c|--creators] [-e|--exclude=] [-f|--excludefolder=] [-v|--verbose]", + "save iar [-h|--home=] [--noassets] [] [-c|--creators] [-e|--exclude=] [-f|--excludefolder=] [-v|--verbose]", "Save user inventory archive (IAR).", " is the user's first name.\n" + " is the user's last name.\n" @@ -184,18 +183,18 @@ } public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) + Guid id, string firstName, string lastName, string invPath, Stream saveStream) { - return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary()); + return ArchiveInventory(id, firstName, lastName, invPath, saveStream, new Dictionary()); } public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, + Guid id, string firstName, string lastName, string invPath, Stream saveStream, Dictionary options) { if (m_scenes.Count > 0) { - UserAccount userInfo = GetUserInfo(firstName, lastName, pass); + UserAccount userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) { @@ -230,7 +229,7 @@ } public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, string savePath, + Guid id, string firstName, string lastName, string invPath, string savePath, Dictionary options) { // if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath)) @@ -238,7 +237,7 @@ if (m_scenes.Count > 0) { - UserAccount userInfo = GetUserInfo(firstName, lastName, pass); + UserAccount userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) { @@ -272,18 +271,18 @@ return false; } - public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) + public bool DearchiveInventory(string firstName, string lastName, string invPath, Stream loadStream) { - return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary()); + return DearchiveInventory(firstName, lastName, invPath, loadStream, new Dictionary()); } public bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, Stream loadStream, + string firstName, string lastName, string invPath, Stream loadStream, Dictionary options) { if (m_scenes.Count > 0) { - UserAccount userInfo = GetUserInfo(firstName, lastName, pass); + UserAccount userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) { @@ -326,12 +325,12 @@ } public bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, string loadPath, + string firstName, string lastName, string invPath, string loadPath, Dictionary options) { if (m_scenes.Count > 0) { - UserAccount userInfo = GetUserInfo(firstName, lastName, pass); + UserAccount userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) { @@ -383,24 +382,23 @@ List mainParams = optionSet.Parse(cmdparams); - if (mainParams.Count < 6) + if (mainParams.Count < 5) { m_log.Error( - "[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] []"); + "[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] []"); return; } string firstName = mainParams[2]; string lastName = mainParams[3]; string invPath = mainParams[4]; - string pass = mainParams[5]; - string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME); + string loadPath = (mainParams.Count > 5 ? mainParams[5] : DEFAULT_INV_BACKUP_FILENAME); m_log.InfoFormat( "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", loadPath, invPath, firstName, lastName); - if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) + if (DearchiveInventory(firstName, lastName, invPath, loadPath, options)) m_log.InfoFormat( "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", loadPath, firstName, lastName); @@ -444,10 +442,10 @@ try { - if (mainParams.Count < 6) + if (mainParams.Count < 5) { m_log.Error( - "[INVENTORY ARCHIVER]: save iar [-h|--home=] [--noassets] [] [-c|--creators] [-e|--exclude=] [-f|--excludefolder=] [-v|--verbose]"); + "[INVENTORY ARCHIVER]: save iar [-h|--home=] [--noassets] [] [-c|--creators] [-e|--exclude=] [-f|--excludefolder=] [-v|--verbose]"); return; } @@ -457,8 +455,7 @@ string firstName = mainParams[2]; string lastName = mainParams[3]; string invPath = mainParams[4]; - string pass = mainParams[5]; - string savePath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME); + string savePath = (mainParams.Count > 5 ? mainParams[5] : DEFAULT_INV_BACKUP_FILENAME); m_log.InfoFormat( "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", @@ -467,7 +464,7 @@ lock (m_pendingConsoleSaves) m_pendingConsoleSaves.Add(id); - ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, options); + ArchiveInventory(id, firstName, lastName, invPath, savePath, options); } catch (InventoryArchiverException e) { @@ -504,9 +501,8 @@ /// /// /// - /// User password /// - protected UserAccount GetUserInfo(string firstName, string lastName, string pass) + protected UserAccount GetUserInfo(string firstName, string lastName) { UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName); @@ -519,26 +515,8 @@ return null; } - try - { - string encpass = Util.Md5Hash(pass); - if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, encpass, 1) != string.Empty) - { - return account; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", - firstName, lastName); - return null; - } - } - catch (Exception e) - { - m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); - return null; - } + return account; + } /// diff -Naur opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs --- opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs 2013-02-08 23:43:42.000000000 +0200 +++ opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs 2013-02-15 18:29:00.000000000 +0200 @@ -72,7 +72,7 @@ // TestHelpers.EnableLogging(); UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); - m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); + m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", m_iarStream); InventoryItemBase coaItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName); @@ -164,7 +164,7 @@ mre.Reset(); m_archiverModule.ArchiveInventory( - Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream); + Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, archiveWriteStream); mre.WaitOne(60000, false); byte[] archive = archiveWriteStream.ToArray(); @@ -261,7 +261,7 @@ // When we're not saving assets, archiving is being done synchronously. m_archiverModule.ArchiveInventory( - Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream, options); + Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, archiveWriteStream, options); byte[] archive = archiveWriteStream.ToArray(); MemoryStream archiveReadStream = new MemoryStream(archive); @@ -330,7 +330,7 @@ UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); - m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); + m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name); @@ -363,7 +363,7 @@ // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); // -// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); +// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", m_iarStream); // InventoryItemBase foundItem1 // = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); // @@ -394,7 +394,7 @@ // log4net.Config.XmlConfigurator.Configure(); UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); - m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); + m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); diff -Naur opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs --- opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs 2013-02-08 23:43:42.000000000 +0200 +++ opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs 2013-02-15 18:20:50.000000000 +0200 @@ -163,7 +163,7 @@ scene.AddInventoryItem(coaItem); archiverModule.ArchiveInventory( - Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); + Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", archiveWriteStream); m_iarStreamBytes = archiveWriteStream.ToArray(); } @@ -175,4 +175,4 @@ mre.Set(); } } -} \ No newline at end of file +} diff -Naur opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs --- opensim-0.7.5-source/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs 2013-02-08 23:43:42.000000000 +0200 +++ opensim-0.7.5-source-iar-nopassword/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs 2013-02-15 18:31:15.000000000 +0200 @@ -111,7 +111,7 @@ // Test saving a particular path mre.Reset(); archiverModule.ArchiveInventory( - Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); + Guid.NewGuid(), userFirstName, userLastName, "Objects", archiveWriteStream); mre.WaitOne(60000, false); byte[] archive = archiveWriteStream.ToArray(); @@ -186,7 +186,7 @@ UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); - archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); + archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); @@ -195,7 +195,7 @@ // Now try loading to a root child folder UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA"); MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); - archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", "meowfood", archiveReadStream); + archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", archiveReadStream); InventoryItemBase foundItem2 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xA/" + m_item1Name); @@ -204,7 +204,7 @@ // Now try loading to a more deeply nested folder UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC"); archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); - archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", "meowfood", archiveReadStream); + archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", archiveReadStream); InventoryItemBase foundItem3 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); @@ -226,7 +226,7 @@ SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); - archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); + archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath( @@ -296,13 +296,13 @@ mre.Reset(); archiverModule.ArchiveInventory( - Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); + Guid.NewGuid(), userFirstName, userLastName, "Objects", archiveWriteStream); mre.WaitOne(60000, false); // LOAD ITEM MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); - archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream); + archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", archiveReadStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath( diff -Naur opensim-0.7.5-source/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs opensim-0.7.5-source-iar-nopassword/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs --- opensim-0.7.5-source/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs 2013-02-08 23:43:42.000000000 +0200 +++ opensim-0.7.5-source-iar-nopassword/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs 2013-02-15 18:02:40.000000000 +0200 @@ -59,7 +59,7 @@ /// The inventory path in which to place the loaded folders and items /// The stream from which the inventory archive will be loaded /// true if the first stage of the operation succeeded, false otherwise - bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream); + bool DearchiveInventory(string firstName, string lastName, string invPath, Stream loadStream); /// /// Dearchive a user's inventory folder from the given stream @@ -72,7 +72,7 @@ /// the loaded IAR with existing folders where possible. /// true if the first stage of the operation succeeded, false otherwise bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, Stream loadStream, + string firstName, string lastName, string invPath, Stream loadStream, Dictionary options); /// @@ -84,7 +84,7 @@ /// The inventory path from which the inventory should be saved. /// The stream to which the inventory archive will be saved /// true if the first stage of the operation succeeded, false otherwise - bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream); + bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, Stream saveStream); /// /// Archive a user's inventory folder to the given stream @@ -97,7 +97,7 @@ /// Archiving options. Currently, there are none. /// true if the first stage of the operation succeeded, false otherwise bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, + Guid id, string firstName, string lastName, string invPath, Stream saveStream, Dictionary options); } }