# HG changeset patch # User Alain Mazy # Date 1602231807 -7200 # Node ID 70da4ce5c7cc5858da954bfe87e613bf011de290 # Parent 8d2b29fd4de50579f3e65d60d29a0085560e8672# Parent 662b9d3f217d7be02312ae99d68018f7a2243edc merge diff -r 662b9d3f217d -r 70da4ce5c7cc Aws/AwsS3StoragePlugin.cpp --- a/Aws/AwsS3StoragePlugin.cpp Sat Oct 03 10:39:45 2020 +0200 +++ b/Aws/AwsS3StoragePlugin.cpp Fri Oct 09 10:23:27 2020 +0200 @@ -130,14 +130,17 @@ { return objectList[0].GetSize(); } - throw StoragePluginException(std::string("error while reading file ") + path_ + ": multiple objet with same name !"); + else if (objectList.size() > 1) + { + throw StoragePluginException(std::string("error while reading file ") + path_ + ": multiple objet with same name !"); + } + throw StoragePluginException(std::string("error while reading file ") + path_ + ": object not found !"); } else { throw StoragePluginException(std::string("error while reading file ") + path_ + ": " + result.GetError().GetExceptionName().c_str() + " " + result.GetError().GetMessage().c_str()); } } - virtual void Read(char* data, size_t size) { Aws::S3::Model::GetObjectRequest getObjectRequest; diff -r 662b9d3f217d -r 70da4ce5c7cc Common/StoragePlugin.cpp --- a/Common/StoragePlugin.cpp Sat Oct 03 10:39:45 2020 +0200 +++ b/Common/StoragePlugin.cpp Fri Oct 09 10:23:27 2020 +0200 @@ -327,6 +327,13 @@ } objectsRootPath = pluginSection.GetStringValue("RootPath", std::string()); + + if (objectsRootPath.size() >= 1 && objectsRootPath[0] == '/') + { + OrthancPlugins::LogError(std::string(StoragePluginFactory::GetStoragePluginName()) + ": The RootPath shall not start with a '/': " + objectsRootPath); + return -1; + } + plugin->SetRootPath(objectsRootPath); if (pluginSection.IsSection(ENCRYPTION_SECTION))