Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5574

camel-sftp's stepwise behavior to walk up and down relatively to avoid potential traversal issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.1
    • 2.9.4, 2.10.2, 2.11.0
    • camel-ftp
    • None
    • Patch Available
    • Unknown

    Description

      I am having a directory traversal problem using the stepwise mode of camel-sftp at the producer side. Basically, it can walk down the path from the starting directory to the walking directory, but it cannot go back correctly to the original starting directly. The server is SSH-2.0-Cleo VLProxy/3.0.1 SSH FTP server.
      I saw a related JIRA issue CAMEL-3309 that describes some issues in the stepwise traversal and some background to this related problem.

      My question is on the part that changes the working directory back to the original starting folder. I am wondering why we are using stepwise traversal from the ancestor directory towards the starting child directory, instead of moving upwards relatively from the working directory back to the starting directory. This reverse traversal does not require accessing the ancestry path above the staring directory (hence, not affected by the accessing problem). And in fact, I think this reverse stepwise traversal seems more natural order than doing stepwise traversal each time from top down. How do you think?

      I have made a change that implements this reverse stepwise traversal in SftpOperations and also made a few minor improvement changes.
      This changed version passes all the existing tests and works also against the above server.

      I am attaching a patch file for this change. I would appreciate if you can comment on it.

      Thanks.
      regards, aki

      Attachments

        1. trunk-camel-ftp.diff
          5 kB
          Akitoshi Yoshida

        Issue Links

          Activity

            People

              njiang Willem Jiang
              ay Akitoshi Yoshida
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: