Repository navigation
GH-397: Handle trailing slashes in SFTP directory operations - #960
Open
wozhenbang2004 wants to merge 2 commits into
Open
wozhenbang2004 wants to merge 2 commits into
wozhenbang2004 wants to merge 2 commits into
Conversation
Path translation appends a dot to mkdir and rmdir paths ending in a slash. Rooted filesystems preserve that component, causing these operations to fail on Unix. Trim only their insignificant trailing slashes before resolving the path, preserving explicit dot and parent components and other operations.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #397.
For
mkdir("dir/")andrmdir("dir/"), path translation appends a dot component. A rooted filesystem keeps that component, so creating or deleting the directory fails on Unix.Strip trailing slashes before resolving these two operations. Explicit dot and parent components remain intact, and other operations retain their trailing-slash semantics.
The SFTP regressions pass with NIO2, MINA, and Netty. They also cover missing parent directories, explicit dots, and directory symlinks. The native formatter, import sorting, and Checkstyle checks pass.
Full reactor verification was also attempted; it stops in core network and host-authentication tests in this environment before reaching SFTP.