summaryrefslogtreecommitdiffstats
path: root/usr.sbin/faithd
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2000-09-17 16:44:51 +0000
committerume <ume@FreeBSD.org>2000-09-17 16:44:51 +0000
commit2c0439307794d3722afd4f04030c04777c4f6fe8 (patch)
tree01510c2a68fb329950e30a87a37a1f05c3704ab5 /usr.sbin/faithd
parenta272c78c36dda57cc98b77b16da54b7b67e989eb (diff)
downloadFreeBSD-src-2c0439307794d3722afd4f04030c04777c4f6fe8.zip
FreeBSD-src-2c0439307794d3722afd4f04030c04777c4f6fe8.tar.gz
cope with the following reply on PASV (without paren). need more tests.
227 Entering Passive Mode x,x,x,x,x,x,x Obtained from: KAME (1.8->1.9)
Diffstat (limited to 'usr.sbin/faithd')
-rw-r--r--usr.sbin/faithd/ftp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/faithd/ftp.c b/usr.sbin/faithd/ftp.c
index 53f94f1..e4838eb 100644
--- a/usr.sbin/faithd/ftp.c
+++ b/usr.sbin/faithd/ftp.c
@@ -449,7 +449,10 @@ ftp_copyresult(int src, int dst, enum state state)
#endif
case LPSV:
case EPSV:
- /* expecting "227 Entering Passive Mode (x,x,x,x,x,x,x)" */
+ /*
+ * expecting "227 Entering Passive Mode (x,x,x,x,x,x,x)"
+ * (in some cases result comes without paren)
+ */
if (code != 227) {
passivefail0:
close(wport6);
@@ -469,11 +472,12 @@ passivefail0:
* PASV result -> LPSV/EPSV result
*/
p = param;
- while (*p && *p != '(')
+ while (*p && *p != '(' && !isdigit(*p)) /*)*/
p++;
if (!*p)
goto passivefail0; /*XXX*/
- p++;
+ if (*p == '(') /*)*/
+ p++;
n = sscanf(p, "%u,%u,%u,%u,%u,%u",
&ho[0], &ho[1], &ho[2], &ho[3], &po[0], &po[1]);
if (n != 6)
@@ -595,7 +599,7 @@ passivefail1:
* EPSV result -> PORT result
*/
p = param;
- while (*p && *p != '(')
+ while (*p && *p != '(') /*)*/
p++;
if (!*p)
goto passivefail1; /*XXX*/
OpenPOWER on IntegriCloud