diff options
author | itojun <itojun@pkgsrc.org> | 2001-02-06 07:07:43 +0000 |
---|---|---|
committer | itojun <itojun@pkgsrc.org> | 2001-02-06 07:07:43 +0000 |
commit | b934ac91a5e3f53a7131162844be1985472f1b13 (patch) | |
tree | 4f5c768c44fd158b48ae6c675f51ca18581ee9b3 /www/lynx-current/patches | |
parent | d3e383eff988398232f22eccc48fd81fe7a16fe0 (diff) | |
download | pkgsrc-b934ac91a5e3f53a7131162844be1985472f1b13.tar.gz |
locally fix passive FTP breakage (patch already submitted to lynx guys).
PR 12141.
Diffstat (limited to 'www/lynx-current/patches')
-rw-r--r-- | www/lynx-current/patches/patch-ad | 94 | ||||
-rw-r--r-- | www/lynx-current/patches/patch-ae | 16 |
2 files changed, 110 insertions, 0 deletions
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. |