You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
put: USER USER
get: 331
put: PASS *****
get: 230
put: TYPE I
get: 200
Get list of files
Note: same issue with get*file()
ftp.list
This is where we fail:
put: TYPE A
get: 200
put: PASV
get: 227 192,168,7,97,199,99
put: TYPE I
get: 200
/usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:1399:in `parse227': 227 192,168,7,97,199,99 (Net::FTPProtoError)
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:545:in `makepasv'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:557:in `transfercmd'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:676:in `block (2 levels) in retrlines'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:317:in `with_binary'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:674:in `block in retrlines'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/3.1.0/monitor.rb:202:in `synchronize'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/3.1.0/monitor.rb:202:in `mon_synchronize'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:673:in `retrlines'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/net-ftp-0.1.3/lib/net/ftp.rb:931:in `list'
from (irb):20:in `<main>'
from /usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /usr/local/opt/ruby/bin/irb:25:in `load'
from /usr/local/opt/ruby/bin/irb:25:in `<main>'
Interacting with the same server via netcat
$ nc -vv 192.168.7.97 51041
device.mydomain.com [192.168.7.97] 51041 (?) open
220 B4X FTP Server
USER quest
331
PASS drive
230
CWD Music
200
PASV
227 192,168,7,97,199,98
LIST
150
226
And on a data connection:
$ nc -vv device.mydomain.com 51042
device.mydomain.com [192.168.7.97] 51042 (?) open
drwxr-xr-x 1 owner group 3488 Mar 10 10:10 Vinyl Reality
sent 0, rcvd 68
The text was updated successfully, but these errors were encountered:
Fixesruby#16
Note: While some FTP servers add the brackets to the 227 response, RFC 959 does not specify them as part of the FTP protocol.
I believe this is a commonly-copy/pasted typo as the RFC docs are as follows:
> 226 Closing data connection.
> Requested file action successful (for example, file
> transfer or file abort).
> 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
> 230 User logged in, proceed.
The issue with example
Setup
Result is as expected:
Login
Result is again as expected:
Get list of files
Note: same issue with
get*file()
This is where we fail:
Interacting with the same server via
netcat
$ nc -vv 192.168.7.97 51041 device.mydomain.com [192.168.7.97] 51041 (?) open 220 B4X FTP Server USER quest 331 PASS drive 230 CWD Music 200 PASV 227 192,168,7,97,199,98 LIST 150 226
And on a data connection:
$ nc -vv device.mydomain.com 51042 device.mydomain.com [192.168.7.97] 51042 (?) open drwxr-xr-x 1 owner group 3488 Mar 10 10:10 Vinyl Reality sent 0, rcvd 68
The text was updated successfully, but these errors were encountered: