Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In SFTP, do not add '/' if homedir ends with one #9844

Closed
wants to merge 1 commit into from

Conversation

evigeant
Copy link
Contributor

@evigeant evigeant commented Nov 2, 2022

When using SFTP and a path relative to the user home, do not add a trailing '/' to the user home dir if it already ends with one.

Background:

We have an SFTP server which serves files out of a virtual directory structure. Because of this, the "HOME" directory for all users is "/" by configuration (we do not have user home directories in the virtual filesystem).

When using curl to upload files with a command such as this:
curl -T file_to_upload.txt sftp://hostname/~/folder/

curl first resolves the home directory to "/" and then uploads the file with this filename: //folder/file_to_upload.txt

In our case, this caused the path to be misinterpreted as a network path which ultimately caused the upload to fail. We will implement a fix in the SFTP server for this.

The fix here is simply such that curl uploads the file with this filename instead in this situation:
/folder/file_to_upload.txt

which is the intended path I believe.

When using SFTP and a path relative to the user home, do not add a trailing '/' to the user home dir if it already ends with one.
bagder
bagder approved these changes Nov 3, 2022
@bagder bagder added the SCP/SFTP label Nov 3, 2022
@bagder
Copy link
Member

bagder commented Nov 3, 2022

Thanks!

@bagder bagder closed this in 6c51ade Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants