Cyberduck Mountain Duck CLI

Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#684 closed enhancement (fixed)

PRET (PRE Transfer) command

Reported by: anonymous Owned by: dkocher
Priority: low Milestone: 3.0
Component: ftp Version: 2.8.4
Severity: normal Keywords:
Cc: Architecture:
Platform:

Description

Some servers, for example drftpd, requires PRET support when connecting in passive mode. It's basically a command that is sent before transfers to inform the server that the client is about to do something.

More info: http://www.drftpd.org/index.php/Distributed_PASV#Solution:_PRET_.28PRE_Transfer.29_command

Attachments (2)

pret_patch (1.6 KB) - added by neothematrix 11 years ago.
Adds the "PRET" feature to Cyberduck, needed for passive transfers with DistributedFTPD (like DrFTPD)
feat_patch (688 bytes) - added by neothematrix 11 years ago.
to make the features() function saves correctly data inside the feature variable

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by dkocher

  • Component changed from core to ftp
  • Priority changed from normal to low

comment:2 Changed 12 years ago by dkocher

  • Resolution set to wontfix
  • Status changed from new to closed

Changed 11 years ago by neothematrix

Adds the "PRET" feature to Cyberduck, needed for passive transfers with DistributedFTPD (like DrFTPD)

comment:3 Changed 11 years ago by neothematrix

  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Version changed from 2.6.1 to 2.8.4

I made a little patch in order to make Cyberduck compatible with PRET enabled ftps, it just send a "PRET command" command before any of the commands specified in the PRET specifications (http://drftpd.org/index.php/PRET_Specifications). The command is sent without checking for any reply, if the server doesn't support the feature, then an error message is sent to Cyberduck and nothing happens. Let me know if something is wrong, i'm not an experienced coder but the patch is really small.

comment:4 Changed 11 years ago by dkocher

Thanks for the patch. I have some notes on this:

  • Should only be sent if the response to FEAT contains PRET.
  • The client is only required to send a PRET command before PASV

comment:5 follow-up: Changed 11 years ago by dkocher

  • Milestone set to 2.9

comment:6 in reply to: ↑ 5 Changed 11 years ago by neothematrix

Replying to dkocher:

a) yes that's what the specs says, but I've seen some servers not spitting out the PRET inside the FEAT command, I think it's better trying to issue a PRET command anyway, in the worst case, we just get a "not implemented" error, and the connection goes on. Also I saw you have a nice "features()" function, but I didn't understand when and if it's called.

b) from the specs: "Must be sent before the PASV and ONLY the PASV command. PRET is unneccessary to be sent before any other command, although it can help enable a security feature on clients using Active transfers." so, leaving PRET enabled also for Active connections is not a bad thing. Anyway, adding a check to see if the connection is passive and, only in that case, issue the PRET command is just a matter of add some "if", so if you think it's better, I can add this check.

comment:7 Changed 11 years ago by dkocher

  • Resolution set to fixed
  • Status changed from reopened to closed

Thanks for comment. I have commited r3481 which makes use of PRET if it is listed in response to FEAT. Needs testing as I don't have access to a drftpd server.

comment:8 follow-up: Changed 11 years ago by neothematrix

an error has been introduced, the server I use for test, allows the use of the FEAT command only to authenticated users:

220 DrFTPD 2.0.2 http://drftpd.org FEAT 530 Not logged in. 220 DrFTPD 2.0.2 http://drftpd.org FEAT 530 Not logged in.

comment:9 in reply to: ↑ 8 Changed 11 years ago by dkocher

Replying to neothematrix:

> 220 DrFTPD 2.0.2 http://drftpd.org
> FEAT
> 530 Not logged in.
> 220 DrFTPD 2.0.2 http://drftpd.org
> FEAT
> 530 Not logged in.

Fixed in r3482.

comment:10 follow-up: Changed 11 years ago by neothematrix

ok, working perfectly now, just a note, now the FEAT command is sent before ANY createDataSocket, not just the first one you didn't save the "features" variable correctly, I wrote a fix :) wow I like patching eheh btw, do you have some additional documentation? I'd like to add support for external IP detection and the selection of a range of ports for the PORT command (in order to make PORT command works behind firewalls)

Changed 11 years ago by neothematrix

to make the features() function saves correctly data inside the feature variable

comment:11 in reply to: ↑ 10 Changed 11 years ago by dkocher

Replying to neothematrix:

ok, working perfectly now, just a note, now the FEAT command is sent before ANY createDataSocket, not just the first one you didn't save the "features" variable correctly, I wrote a fix :) wow I like patching eheh btw, do you have some additional documentation? I'd like to add support for external IP detection and the selection of a range of ports for the PORT command (in order to make PORT command works behind firewalls)

Thanks for watching :) Fixed in r3483. I don't have any more documentation, but you may find at [enterprisedt.net].

Note: See TracTickets for help on using tickets.
swiss made software