Skip to content

GH-397: Handle trailing slashes in SFTP directory operations - #960

Open
wozhenbang2004 wants to merge 2 commits into
apache:masterfrom
wozhenbang2004:fix-sftp-directory-trailing-slash-397
Open

wozhenbang2004 wants to merge 2 commits into
apache:masterfrom
wozhenbang2004:fix-sftp-directory-trailing-slash-397

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Fixes #397.

For mkdir("dir/") and rmdir("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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The RootedFileSystemProvider.resolveLocalPath() does not return normilized path any more

1 participant