Browse Source

HPCC-15428 CLocalEnvironment doesn't check properly the drop zone path in
getDropZoneByAddressPath() function.

Add path separator character at the end of the drop zone path (if there
is not any) before compare it to the target file path.

Signed-off-by: Attila Vamos <attila.vamos@gmail.com>

Attila Vamos 9 years ago
parent
commit
a24674333a
1 changed files with 5 additions and 4 deletions
  1. 5 4
      common/environment/environment.cpp

+ 5 - 4
common/environment/environment.cpp

@@ -1576,12 +1576,13 @@ IConstDropZoneInfo * CLocalEnvironment::getDropZoneByAddressPath(const char * ne
 
 
     ForEach(*zoneIt)
     ForEach(*zoneIt)
     {
     {
-        SCMStringBuffer dropZoneName;
-        zoneIt->query().getName(dropZoneName);
-
         SCMStringBuffer dropZoneDir;
         SCMStringBuffer dropZoneDir;
         zoneIt->query().getDirectory(dropZoneDir);
         zoneIt->query().getDirectory(dropZoneDir);
-        const char * pdropzoneDir = dropZoneDir.str();
+        StringBuffer fullDropZoneDir(dropZoneDir.str());
+        const char pathSeparator = fullDropZoneDir.charAt(0);
+        if (fullDropZoneDir.charAt(fullDropZoneDir.length()) != pathSeparator)
+            fullDropZoneDir.append(pathSeparator);
+        const char * pdropzoneDir = fullDropZoneDir.str();
 
 
         // Check target file path starts with this Drop zone path
         // Check target file path starts with this Drop zone path
         // the drop zone paths can be nested (nothing forbids it) like
         // the drop zone paths can be nested (nothing forbids it) like