diff options
author | itojun <itojun> | 2001-02-06 07:07:43 +0000 |
---|---|---|
committer | itojun <itojun> | 2001-02-06 07:07:43 +0000 |
commit | b7269d5f1dd8ee38ebb169fedc8da7f9a2ab551a (patch) | |
tree | 4f5c768c44fd158b48ae6c675f51ca18581ee9b3 /www/lynx-current | |
parent | e12ce47abfeb200807e5a9263ace750b4de26bce (diff) | |
download | pkgsrc-b7269d5f1dd8ee38ebb169fedc8da7f9a2ab551a.tar.gz |
locally fix passive FTP breakage (patch already submitted to lynx guys).
PR 12141.
Diffstat (limited to 'www/lynx-current')
-rw-r--r-- | www/lynx-current/files/patch-sum | 4 | ||||
-rw-r--r-- | www/lynx-current/patches/patch-ad | 94 | ||||
-rw-r--r-- | www/lynx-current/patches/patch-ae | 16 |
3 files changed, 113 insertions, 1 deletions
diff --git a/www/lynx-current/files/patch-sum b/www/lynx-current/files/patch-sum index 0be62479f27..1d012b8c347 100644 --- a/www/lynx-current/files/patch-sum +++ b/www/lynx-current/files/patch-sum @@ -1,5 +1,7 @@ -$NetBSD: patch-sum,v 1.3 2000/11/01 17:33:44 itojun Exp $ +$NetBSD: patch-sum,v 1.4 2001/02/06 07:07:43 itojun Exp $ MD5 (patch-aa) = 072f8a39714a5fe048b2f22d0d81d36f MD5 (patch-ab) = 045fec4a443e066bdfa6f88202528d3a MD5 (patch-ac) = ec10e0f1cc88c81237e75262dce63d6f +MD5 (patch-ad) = f90d7b543fce9491af13faf73a2a611c +MD5 (patch-ae) = 1d4215fb03b50b7dfb3a0443fbb4418e diff --git a/www/lynx-current/patches/patch-ad b/www/lynx-current/patches/patch-ad new file mode 100644 index 00000000000..72c504cf3aa --- /dev/null +++ b/www/lynx-current/patches/patch-ad @@ -0,0 +1,94 @@ +$NetBSD: patch-ad,v 1.1 2001/02/06 07:07:44 itojun Exp $ + +--- WWW/Library/Implementation/HTFTP.c.orig Fri Sep 22 11:21:59 2000 ++++ WWW/Library/Implementation/HTFTP.c Tue Feb 6 15:59:19 2001 +@@ -2992,15 +2992,18 @@ + char command[LINE_LENGTH+1]; + char *p; + int h0, h1, h2, h3, p0, p1; /* Parts of reply */ ++#ifdef INET6 ++ char dst[LINE_LENGTH+1]; ++#endif + + data_soc = status; + + #ifdef INET6 +- status = send_cmd_1("EPSV"); ++ status = send_cmd_1(p = "EPSV"); + if (status < 0) /* retry or Bad return */ + continue; + else if (status != 2) { +- status = send_cmd_1("PASV"); ++ status = send_cmd_1(p = "PASV"); + if (status < 0) /* retry or Bad return */ + continue; + else if (status != 2) { +@@ -3008,7 +3011,7 @@ + } + } + +- if (strncmp(command, "PASV", 4) == 0) { ++ if (strcmp(p, "PASV") == 0) { + for (p = response_text; *p && *p != ','; p++) + ; /* null body */ + +@@ -3021,26 +3024,37 @@ + return -99; + } + passive_port = (p0<<8) + p1; +- } else if (strncmp(command, "EPSV", 4) == 0) { ++ snprintf(dst, sizeof(dst), "%d.%d.%d.%d", h0, h1, h2, h3); ++ } else if (strcmp(p, "EPSV") == 0) { + unsigned char c0, c1, c2, c3; ++ struct sockaddr_storage ss; ++ int sslen; ++ + /* +- * EPSV |||port| ++ * EPSV bla (|||port|) + */ + for (p = response_text; *p && !isspace(*p); p++) + ; /* null body */ +- for (p = response_text; *p && isspace(*p); p++) ++ for (/*nothing*/; *p && *p && *p != '('; p++) /*)*/ + ; /* null body */ +- status = sscanf(p+1, "%c%c%c%d%c", +- &c0, &c1, &c2, &p0, &c3); ++ status = sscanf(p, "(%c%c%c%d%c)", &c0, &c1, &c2, &p0, &c3); + if (status != 5) { + fprintf(tfp, "HTFTP: EPSV reply has invalid format!\n"); + return -99; + } +- h0 = c0; +- h1 = c1; +- h2 = c2; +- h3 = c3; + passive_port = p0; ++ ++ sslen = sizeof(ss); ++ if (getpeername(control->socket, (struct sockaddr *)&ss, ++ &sslen) < 0) { ++ fprintf(tfp, "HTFTP: getpeername(control) failed\n"); ++ return -99; ++ } ++ if (getnameinfo((struct sockaddr *)&ss, sslen, dst, ++ sizeof(dst), NULL, 0, NI_NUMERICHOST)) { ++ fprintf(tfp, "HTFTP: getnameinfo failed\n"); ++ return -99; ++ } + } + #else + status = send_cmd_1("PASV"); +@@ -3068,8 +3082,12 @@ + + /* Open connection for data: */ + ++#ifdef INET6 ++ sprintf(command, "ftp://%s:%d/", dst, passive_port); ++#else + sprintf(command, "ftp://%d.%d.%d.%d:%d/", + h0, h1, h2, h3, passive_port); ++#endif + status = HTDoConnect(command, "FTP data", passive_port, &data_soc); + + if (status < 0) { diff --git a/www/lynx-current/patches/patch-ae b/www/lynx-current/patches/patch-ae new file mode 100644 index 00000000000..7a157b99ba7 --- /dev/null +++ b/www/lynx-current/patches/patch-ae @@ -0,0 +1,16 @@ +$NetBSD: patch-ae,v 1.1 2001/02/06 07:07:44 itojun Exp $ + +--- WWW/Library/Implementation/HTParse.c.orig Wed Dec 15 20:03:18 1999 ++++ WWW/Library/Implementation/HTParse.c Tue Feb 6 15:58:26 2001 +@@ -291,7 +291,11 @@ + char *p2, *h; + if ((p2 = strchr(result, '@')) != NULL) + tail = (p2 + 1); ++#ifdef INET6 ++ p2 = strrchr(tail, ':'); ++#else + p2 = strchr(tail, ':'); ++#endif + if (p2 != NULL && !isdigit((unsigned char)p2[1])) + /* + ** Colon not followed by a port number. |