diff options
author | Melanie | 2010-09-02 00:00:54 +0100 |
---|---|---|
committer | Melanie | 2010-09-02 00:00:54 +0100 |
commit | 93edc75147d5a819cc4e30699ecb859820aa9b7f (patch) | |
tree | ea6e2c0497fc01589e6f7b2e4346ec9f51a8c01b | |
parent | Fix sqlite migration problems by moving migrations in 019_RegionStore.sql and... (diff) | |
download | opensim-SC-93edc75147d5a819cc4e30699ecb859820aa9b7f.zip opensim-SC-93edc75147d5a819cc4e30699ecb859820aa9b7f.tar.gz opensim-SC-93edc75147d5a819cc4e30699ecb859820aa9b7f.tar.bz2 opensim-SC-93edc75147d5a819cc4e30699ecb859820aa9b7f.tar.xz |
Disallow modification of system folders. Prevent changing the type of folders
and prevent resetting the version number
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 84306e7..02d7170 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -293,13 +293,28 @@ namespace OpenSim.Services.InventoryService | |||
293 | 293 | ||
294 | public virtual bool AddFolder(InventoryFolderBase folder) | 294 | public virtual bool AddFolder(InventoryFolderBase folder) |
295 | { | 295 | { |
296 | InventoryFolderBase check = GetFolder(folder); | ||
297 | if (check != null) | ||
298 | return false; | ||
299 | |||
296 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); | 300 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
297 | return m_Database.StoreFolder(xFolder); | 301 | return m_Database.StoreFolder(xFolder); |
298 | } | 302 | } |
299 | 303 | ||
300 | public virtual bool UpdateFolder(InventoryFolderBase folder) | 304 | public virtual bool UpdateFolder(InventoryFolderBase folder) |
301 | { | 305 | { |
302 | return AddFolder(folder); | 306 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
307 | InventoryFolderBase check = GetFolder(folder); | ||
308 | if (check == null) | ||
309 | return AddFolder(folder); | ||
310 | |||
311 | if (check.Type != -1 || xFolder.type != -1) | ||
312 | return false; | ||
313 | |||
314 | xFolder.version = check.Version; | ||
315 | xFolder.folderID = check.ID; | ||
316 | |||
317 | return m_Database.StoreFolder(xFolder); | ||
303 | } | 318 | } |
304 | 319 | ||
305 | public virtual bool MoveFolder(InventoryFolderBase folder) | 320 | public virtual bool MoveFolder(InventoryFolderBase folder) |