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 prequotes ignored if URL is directory #8602

Closed
anon00000000 opened this issue Mar 17, 2022 · 4 comments
Closed

FTP prequotes ignored if URL is directory #8602

anon00000000 opened this issue Mar 17, 2022 · 4 comments

Comments

@anon00000000
Copy link

@anon00000000 anon00000000 commented Mar 17, 2022

I did this

$ curl -v ftp://anonymous@user/pub/ -Q '+DELE dummy'
*   Trying 192.9.210.201...
* TCP_NODELAY set
* Connected to user (192.9.210.201) port 21 (#0)
< 220 (vsFTPd 3.0.3)
> USER anonymous
< 230 Login successful.
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD pub
* ftp_perform ends with SECONDARY: 0
< 250 Directory successfully changed.
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||18251|)
*   Trying 192.9.210.201...
* TCP_NODELAY set
* Connecting to 192.9.210.201 (192.9.210.201) port 18251
* Connected to user (192.9.210.201) port 21 (#0)
> TYPE A
< 200 Switching to ASCII mode.
> LIST
< 150 Here comes the directory listing.
* Maxdownload = -1
-rw-rw-rw-    1 ftp      ftp          2367 Mar 17 10:12 dummy
* Remembering we are in dir "pub/"
< 226 Directory send OK.
* Connection #0 to host user left intact

I expected the following

DELE dummy command sent after CWD.

curl/libcurl version

Reproduced with the latest (7.82.0) static build from the download page.

operating system

Ubuntu 18.04.6

Linux ZBook-user 5.4.0-104-generic #118~18.04.1-Ubuntu SMP Thu Mar 3 13:53:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

A debug build of curl git did assure me the prequotes were ignored. Using postquotes work.

@jay jay changed the title FTP prequotes not sent FTP prequotes ignored if URL is directory Mar 17, 2022
@jay jay added the FTP label Mar 17, 2022
@jay
Copy link
Member

@jay jay commented Mar 17, 2022

I don't think it ever worked like that and I don't know why it doesn't... Try this: ftp://anonymous@user/pub/dummy -Q '+DELE dummy'

@anon00000000
Copy link
Author

@anon00000000 anon00000000 commented Mar 18, 2022

Hmmm, thanks, it works, but I indeed expected the original to work too.

@bagder
Copy link
Member

@bagder bagder commented Mar 18, 2022

It seems the state machine was just never done for doing "prequotes" for directory listings!

@bagder
Copy link
Member

@bagder bagder commented Mar 22, 2022

I'm not too eager to work on polishing the FTP state machine to make this work. At least not in the short term. I personally will prefer to document this as a known limitation for the prequote functionality.

bagder added a commit that referenced this issue Mar 29, 2022
Also add to quote.d. Add to TODO as something to add in a future.

Reported-by: anon00000000 on github
Closes #8602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants