public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Patch for setup-2.218.2.9 (problem with FTP)
@ 2002-05-22 11:18 Marcel Telka
  0 siblings, 0 replies; only message in thread
From: Marcel Telka @ 2002-05-22 11:18 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

Hi.

I've found little problem in the cygwin setup program (version 2.218.2.9):

There is no possibility to download files from some FTP servers (like
djb's publicfile ftpd http://cr.yp.to/publicfile/ftpd.html) because
the setup scans for '(' in a PASV FTP reply (code 227).

djb's ftpd uses this format for PASV reply:

   227 =h1,h2,h3,h4,p1,p2


RFC 1123 (in section 4.1.2.6) says:

<cite>
The format of the 227 reply to a PASV command is not well standardized.
In particular, an FTP client cannot assume that the parentheses shown
on page 40 of RFC-959 will be present (and in fact, Figure 3 on page 43
omits them). Therefore, a User-FTP program that interprets the PASV reply
must scan the reply for the first digit of the host and port numbers. 
</cite>

I've considered this as bug in the setup and created patch for nio-ftp.cc
file (see attachment). Please apply this patch to the sources. Thanks.

Note: I'm not subscribed to cygwin@cygwin.com list.

Regards.

-- 
+-------------------------------------------+
| Marcel Telka   e-mail:   marcel@telka.sk  |
|                homepage: http://telka.sk/ |
|                jabber:   marcel@jabber.sk |
+-------------------------------------------+

[-- Attachment #2: cygwin-setup-ftp.patch --]
[-- Type: text/plain, Size: 582 bytes --]

--- nio-ftp.cc.orig	2002-02-18 14:53:06.000000000 +0100
+++ nio-ftp.cc	2002-05-22 17:14:06.000000000 +0200
@@ -125,13 +125,13 @@ NetIO_FTP::NetIO_FTP (char const *Purl, 
     return;
 
   char *
-    paren = strchr (last_line, '(');
-  if (!paren)
+    digit = strpbrk (last_line + 3, "0123456789");
+  if (!digit)
     return;
 
   int
     i1, i2, i3, i4, p1, p2;
-  sscanf (paren + 1, "%d,%d,%d,%d,%d,%d", &i1, &i2, &i3, &i4, &p1, &p2);
+  sscanf (digit, "%d,%d,%d,%d,%d,%d", &i1, &i2, &i3, &i4, &p1, &p2);
   char
     tmp[20];
   sprintf (tmp, "%d.%d.%d.%d", i1, i2, i3, i4);


[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-22 15:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-22 11:18 Patch for setup-2.218.2.9 (problem with FTP) Marcel Telka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).