diff options
author | Denys Vlasenko | 2018-02-04 18:49:31 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-02-04 18:49:31 +0100 |
commit | daa643205f76da5cb3e899aba2a047fc2c6f1994 (patch) | |
tree | 8cb91a4c36f95151eac681da949dc5e9d7dc7044 /networking/ftpgetput.c | |
parent | 565af2322271984edf6eb533f90789e52e311848 (diff) | |
download | busybox-daa643205f76da5cb3e899aba2a047fc2c6f1994.zip busybox-daa643205f76da5cb3e899aba2a047fc2c6f1994.tar.gz |
ftpgetput: preparations for ESPV support, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r-- | networking/ftpgetput.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index e866a77..3f98e07 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c @@ -174,24 +174,25 @@ For example, vsftp happily answers TODO2: need to stop ignoring IP address in PASV response. */ + //if (ftpcmd("EPSV", NULL) != 229) { + if (ftpcmd("PASV", NULL) != 227) { + ftp_die("PASV"); + } - if (ftpcmd("PASV", NULL) != 227) { - ftp_die("PASV"); - } - - /* Response is "NNN garbageN1,N2,N3,N4,P1,P2[)garbage] - * Server's IP is N1.N2.N3.N4 (we ignore it) - * Server's port for data connection is P1*256+P2 */ - buf_ptr = strrchr(buf, ')'); - if (buf_ptr) *buf_ptr = '\0'; + /* Response is "NNN garbageN1,N2,N3,N4,P1,P2[)garbage] + * Server's IP is N1.N2.N3.N4 (we ignore it) + * Server's port for data connection is P1*256+P2 */ + buf_ptr = strrchr(buf, ')'); + if (buf_ptr) *buf_ptr = '\0'; - buf_ptr = strrchr(buf, ','); - *buf_ptr = '\0'; - port_num = xatoul_range(buf_ptr + 1, 0, 255); + buf_ptr = strrchr(buf, ','); + *buf_ptr = '\0'; + port_num = xatoul_range(buf_ptr + 1, 0, 255); - buf_ptr = strrchr(buf, ','); - *buf_ptr = '\0'; - port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256; + buf_ptr = strrchr(buf, ','); + *buf_ptr = '\0'; + port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256; + //} set_nport(&lsa->u.sa, htons(port_num)); return xconnect_stream(lsa); |