Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: zftp data handling

Peter Stephenson wrote:
> Found a bug when trying to get IPv6 to work.  There could be more, since
> although I can connect to the server it's giving odd responses which it
> doesn't when I use IPv4.

There are a couple of typos in the handling of port commands.
Given these are presumably fatal I suppose there wasn't kit around to
test it on at the time, so three small errors is pretty good going.  I
won't guarantee it's all A1, but it does seem to do the basics now.

Index: Src/Modules/zftp.c
RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v
retrieving revision 1.25
diff -u -r1.25 zftp.c
--- Src/Modules/zftp.c	18 Apr 2002 11:39:16 -0000	1.25
+++ Src/Modules/zftp.c	25 Apr 2002 14:00:10 -0000
@@ -863,7 +863,7 @@
 	zwarnnam(name, "Must set preference S or P to transfer data", NULL, 0);
 	return 1;
-    zfsess->dfd = socket(AF_INET, SOCK_STREAM, 0);
+    zfsess->dfd = socket(zfsess->control->peer.a.sa_family, SOCK_STREAM, 0);
     if (zfsess->dfd < 0) {
 	zwarnnam(name, "can't get data socket: %e", NULL, errno);
 	return 1;
@@ -907,7 +907,7 @@
 	    delim = ptr[1];
 	    if(delim < 33 || delim > 126 || ptr[2] != delim || ptr[3] != delim)
 		goto bad_epsv;
-	    ptr += 3;
+	    ptr += 4;
 	    end = strchr(ptr, delim);
 	    if(!end || end[1] != ')')
 		goto bad_epsv;

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

Messages sorted by: Reverse Date, Date, Thread, Author