diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 2beea8ef6f..55005572ba 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version
+ /// bumps here should be compatible.
+ ///
+ public static int MAX_MAJOR_VERSION = 0;
+
protected TarArchiveReader archive;
private UserAccount m_userInfo;
@@ -476,8 +482,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
XElement archiveElement = doc.Element("archive");
- int.Parse(archiveElement.Attribute("major_version").Value);
- int.Parse(archiveElement.Attribute("minor_version").Value);
+ int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
+ int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
+ string version = string.Format("{0}.{1}", majorVersion, minorVersion);
+
+ if (majorVersion > MAX_MAJOR_VERSION)
+ {
+ throw new Exception(
+ string.Format(
+ "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
+ majorVersion, MAX_MAJOR_VERSION));
+ }
+
+ m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
}
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 087d3dfed0..117b2fd2fc 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
///
- /// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version
+ /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version
/// bumps here should be compatible.
///
public static int MAX_MAJOR_VERSION = 0;