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

FTP: CURLFTPMETHOD_NOCWD does not URL-decode the path #1974

Closed
Zenju opened this issue Oct 9, 2017 · 7 comments
Closed

FTP: CURLFTPMETHOD_NOCWD does not URL-decode the path #1974

Zenju opened this issue Oct 9, 2017 · 7 comments

Comments

@Zenju
Copy link
Contributor

Zenju commented Oct 9, 2017

I did this

An FTP transfer with CURLFTPMETHOD_NOCWD selected.

A URL with one or more URL encoded "letters".

I expected the following

The path to be URL decoded by curl before use.

curl/libcurl version

any

operating system

any

@Zenju
Copy link
Contributor Author

Zenju commented Oct 9, 2017

I'm basically having the same issue as in #1812
When CURLFTPMETHOD_NOCWD is used and the URL contains a hash, e.g. "/dir/#name", then the rest including the hash is stripped, resulting in a file not found error because lstArg is "/dir/" from the code example in the other ticket.

@jzakrzewski
Copy link
Contributor

Then you should have read @bagder 's comment on the issue: #1812 (comment)
Since "#" has special meaning in the URL, it must be URL-encoded when used outside it's meaning.

@Zenju
Copy link
Contributor Author

Zenju commented Oct 9, 2017

Okay, let's see what happens when we urlencode the string...

lstArg becomes /dir/%23name, still file not found, ups...

Remember, Curl does not urldecode the string in the CURLFTPMETHOD_NOCWD case

@bagder
Copy link
Member

bagder commented Oct 9, 2017

That is a bug.

@bagder bagder changed the title FTP: CURLFTPMETHOD_NOCWD + # not working 2 FTP: CURLFTPMETHOD_NOCWD does not URL-decode the path Oct 9, 2017
@bagder
Copy link
Member

bagder commented Oct 9, 2017

I can't reproduce. So I edited test 298 to use an URL encoded path with nocwd (see commit above) and it works just fine.

@Zenju
Copy link
Contributor Author

Zenju commented Oct 10, 2017

It seems CURLOPT_CUSTOMREQUEST "MLSD" is needed to reproduce

@bagder
Copy link
Member

bagder commented Oct 10, 2017

Not quite. But it seems a directory listing is needed!

bagder added a commit that referenced this issue Oct 10, 2017
Reported-by: Zenju on github

Test 244 added to verify
Fixes #1974
@bagder bagder closed this as completed in ecf21c5 Oct 10, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants