You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/07 13:56:06 UTC

[airavata-mft] 01/01: Fix checking that child path is a subdirectory of resource path

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch fix-child-path-check
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git

commit 0d85288bf3f85a21d1e0cf4d978ff7ba81fbaf7a
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jul 7 09:55:51 2021 -0400

    Fix checking that child path is a subdirectory of resource path
---
 .../org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java b/transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java
index 4f72151..08314dc 100644
--- a/transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java
+++ b/transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java
@@ -254,7 +254,7 @@ public class SCPMetadataCollector implements MetadataCollector {
             case DIRECTORY:
                 resourcePath = resource.getDirectory().getResourcePath();
                 if (isChildPath) {
-                    if (!resourcePath.startsWith(childResourcePath)) {
+                    if (!childResourcePath.startsWith(resourcePath)) {
                         throw new Exception("Child path " + childResourcePath + " is not in the parent path " + resourcePath);
                     }
                     resourcePath = childResourcePath;