Code

iar_nopassword_0.7.6.patch
--- ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs.orig	2013-10-04 19:45:02.000000000 +0000
+++ ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs	2013-10-16 00:46:01.000000000 +0000
@@ -114,20 +114,19 @@
 
                 scene.AddCommand(
                     "Archiving", this, "load iar",
-                    "load iar [-m|--merge] <first> <last> <inventory path> <password> [<IAR path>]",
+                    "load iar [-m|--merge] <first> <last> <inventory path> [<IAR path>]",
                     "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"
                     + "<first> is user's first name." + Environment.NewLine
                     + "<last> is user's last name." + Environment.NewLine
                     + "<inventory path> is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine
-                    + "<password> is the user's password." + Environment.NewLine
                     + "<IAR path> 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=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]",
+                    "save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]",
                     "Save user inventory archive (IAR).",
                     "<first> is the user's first name.\n"
                     + "<last> 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<string, object>());
+            return ArchiveInventory(id, firstName, lastName, invPath, saveStream, new Dictionary<string, object>());
         }
 
         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<string, object> 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<string, object> 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<string, object>());
+            return DearchiveInventory(firstName, lastName, invPath, loadStream, new Dictionary<string, object>());
         }
 
         public bool DearchiveInventory(
-            string firstName, string lastName, string invPath, string pass, Stream loadStream,
+            string firstName, string lastName, string invPath, Stream loadStream,
             Dictionary<string, object> 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<string, object> 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<string> mainParams = optionSet.Parse(cmdparams);
 
-                if (mainParams.Count < 6)
+                if (mainParams.Count < 5)
                 {
                     m_log.Error(
-                        "[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] <first name> <last name> <inventory path> <user password> [<load file path>]");
+                        "[INVENTORY ARCHIVER]: usage is load iar [-m|--merge] <first name> <last name> <inventory path> [<load file path>]");
                     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=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]");
+                        "[INVENTORY ARCHIVER]: save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-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 @@
         /// </summary>
         /// <param name="firstName"></param>
         /// <param name="lastName"></param>
-        /// <param name="pass">User password</param>
         /// <returns></returns>
-        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);
@@ -518,27 +514,7 @@
                     firstName, lastName);
                 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);
-                return null;
-            }
+            return account;
         }
 
         /// <summary>
--- ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs.orig	2013-10-16 00:52:58.000000000 +0000
+++ ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs	2013-10-16 00:53:29.000000000 +0000
@@ -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();
         }
--- ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs.orig	2013-10-16 00:46:32.000000000 +0000
+++ ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs	2013-10-16 01:01:58.000000000 +0000
@@ -70,7 +70,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);
 
@@ -79,7 +79,7 @@
             // Now try loading to a root child folder
             UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false);
             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);
@@ -88,7 +88,7 @@
             // Now try loading to a more deeply nested folder
             UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC", false);
             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);
@@ -110,7 +110,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(
@@ -180,13 +180,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(
--- ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs.orig	2013-10-16 00:48:52.000000000 +0000
+++ ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs	2013-10-16 00:50:20.000000000 +0000
@@ -110,7 +110,7 @@
 
             mre.Reset();
             m_archiverModule.ArchiveInventory(
-                Guid.NewGuid(), userFirstName, userLastName, "/", userPassword, archiveWriteStream);
+                Guid.NewGuid(), userFirstName, userLastName, "/", archiveWriteStream);
             mre.WaitOne(60000, false);
 
             // Test created iar
@@ -179,7 +179,7 @@
 
             mre.Reset();
             m_archiverModule.ArchiveInventory(
-                Guid.NewGuid(), userFirstName, userLastName, "f1", userPassword, archiveWriteStream);
+                Guid.NewGuid(), userFirstName, userLastName, "f1", archiveWriteStream);
             mre.WaitOne(60000, false);
 
             // Test created iar
@@ -267,7 +267,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();
@@ -364,7 +364,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);
--- ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs.orig	2013-10-16 00:46:40.000000000 +0000
+++ ./OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs	2013-10-16 01:03:30.000000000 +0000
@@ -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);
@@ -107,7 +107,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);
 
@@ -171,7 +171,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);
--- ./OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs.orig	2013-10-16 00:55:45.000000000 +0000
+++ ./OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs	2013-10-16 00:57:59.000000000 +0000
@@ -59,7 +59,7 @@
         /// <param name="invPath">The inventory path in which to place the loaded folders and items</param>
         /// <param name="loadStream">The stream from which the inventory archive will be loaded</param>
         /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
-        bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream);
+        bool DearchiveInventory(string firstName, string lastName, string invPath, Stream loadStream);
 
         /// <summary>
         /// Dearchive a user's inventory folder from the given stream
@@ -72,7 +72,7 @@
         /// the loaded IAR with existing folders where possible.</param>
         /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
         bool DearchiveInventory(
-            string firstName, string lastName, string invPath, string pass, Stream loadStream,
+            string firstName, string lastName, string invPath, Stream loadStream,
             Dictionary<string, object> options);
 
         /// <summary>
@@ -84,7 +84,7 @@
         /// <param name="invPath">The inventory path from which the inventory should be saved.</param>
         /// <param name="saveStream">The stream to which the inventory archive will be saved</param>
         /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
-        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);
 
         /// <summary>
         /// Archive a user's inventory folder to the given stream
@@ -97,7 +97,7 @@
         /// <param name="options">Archiving options.  Currently, there are none.</param>
         /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
         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<string, object> options);
     }
 }

opensim/server_patches/disable_iar_passwords/0.7.6.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.