cathery / sys-ftpd

Nintendo Switch FTP server as a background service (sysmodule)
GNU General Public License v3.0
240 stars 14 forks source link

Invalid PASV response #7

Closed TheLastZombie closed 4 years ago

TheLastZombie commented 4 years ago

I recently tried to use this together with rclone, and when I tried to connect to the server, I got the following error:

error listing: invalid PASV response format

I have two other FTP servers set up, both working fine, so I ran the PASV command on them manually:

227 Entering Passive Mode (192,168,178,24,160,99)
227 Entering Passive Mode (192,168,178,91,238,166)

Looking at rclone's code it makes sense, since it's looking for parantheses: https://github.com/rclone/rclone/blob/master/vendor/github.com/jlaffaye/ftp/ftp.go#L363-L369

sys-ftpd-light, however, responds with:

227 192,168,178,39,184,244

So I tried to figure out whether this is an issue with sys-ftpd-light or rclone, and ended up taking a look at RFC 959, and there too the response is:

227 Entering Passive Mode (h1,h2,h3,h4,p1,p2)

The next thing I thought is that this may be an issue with pure-ftpd, however after I set it up and ran PASV, I got:

227 Entering Passive Mode (127,0,0,1,192,238)

Since the original sys-ftpd and ftpd haven't seen new releases in almost a year now, I'd appreciate it if this could get fixed in sys-ftpd-light instead. Thanks!

cathery commented 4 years ago

Ah sorry, so the issue is that it doesn't add parantheses? I don't know what is happening inside the actual FTP implementation, as the original code isn't mine. I'll try to take a look

TheLastZombie commented 4 years ago

Adding parentheses would solve the issue with rclone, but there may be other programs with stricter implementations, so I'd add Entering Passive Mode too.

jam1garner commented 4 years ago

I hate to be this guy image

but this broke my parsing of this. Good change though, I've been wishing for this for a while! Thanks!