Date: Tue, 25 Jun 2002 20:50:25 +0200 (CEST) From: Christian Weisgerber <naddy@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/39853: ftp/ncftp3 is broken on 64-bit archs Message-ID: <200206251850.g5PIoPZ9004285@kemoauc.mips.inka.de>
next in thread | raw e-mail | index | archive | help
>Number: 39853 >Category: ports >Synopsis: ftp/ncftp3 is broken on 64-bit archs >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 25 12:00:07 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Christian Weisgerber >Release: FreeBSD 5.0-CURRENT alpha >Organization: >Environment: System: FreeBSD kemoauc.mips.inka.de 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon Jun 10 07:53:21 CEST 2002 naddy@kemoauc.mips.inka.de:/usr/obj/usr/src/sys/KEMOAUC alpha >Description: ftp/ncftp3 is broken on 64-bit architectures (alpha, sparc64). It cannot establish a connection to a remote host. The problem are two ioctl() calls in sio/SConnect.c, where the second argument is explicitly cast to int. On BSD, ioctl()'s second parameter is of type long, and the argument is cast back due to the prototype. Since BSD ioctl numbers tend to have the 32nd bit set, the argument is sign-extended on 64-bit archs, and we end up with an invalid request. Also, the KAME patch uses sscanf() with a conversion specifier of %d to read into a variable of type short. >How-To-Repeat: >Fix: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/ftp/ncftp3/Makefile,v retrieving revision 1.89 diff -u -r1.89 Makefile --- Makefile 13 Jun 2002 17:15:45 -0000 1.89 +++ Makefile 25 Jun 2002 18:40:14 -0000 @@ -8,7 +8,7 @@ PORTNAME= ncftp PORTVERSION= 3.1.3 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= ftp ipv6 MASTER_SITES= ftp://ftp.ncftp.com/ncftp/ DISTNAME= ncftp-${PORTVERSION}-src Index: files/patch-libncftp_ftp.c =================================================================== RCS file: files/patch-libncftp_ftp.c diff -N files/patch-libncftp_ftp.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-libncftp_ftp.c 25 Jun 2002 18:40:14 -0000 @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- libncftp/ftp.c.orig Tue Jun 25 20:13:11 2002 ++++ libncftp/ftp.c Tue Jun 25 20:13:40 2002 +@@ -694,7 +694,7 @@ + if (isdigit((int) *cp)) + break; + } +- if (sscanf(cp, "%d|", &port) != 1) { ++ if (sscanf(cp, "%hd|", &port) != 1) { + Error(cip, kDontPerror, "Cannot parse EPSV response: %s\n", rp->msg.first->line); + goto next; + } Index: files/patch-sio_SConnect.c =================================================================== RCS file: files/patch-sio_SConnect.c diff -N files/patch-sio_SConnect.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-sio_SConnect.c 25 Jun 2002 18:40:14 -0000 @@ -0,0 +1,23 @@ + +$FreeBSD$ + +--- sio/SConnect.c.orig Tue Jun 25 20:03:09 2002 ++++ sio/SConnect.c Tue Jun 25 20:05:56 2002 +@@ -95,7 +95,7 @@ + # pragma message save + # pragma message disable intconcastsgn + # endif +- if (ioctlsocket(sfd, (int) FIONBIO, &opt) != 0) { ++ if (ioctlsocket(sfd, FIONBIO, &opt) != 0) { + SETERRNO + return (-1); + } +@@ -242,7 +242,7 @@ + # pragma message disable intconcastsgn + # endif + opt = 0; +- if (ioctlsocket(sfd, (int) FIONBIO, &opt) != 0) { ++ if (ioctlsocket(sfd, FIONBIO, &opt) != 0) { + SETERRNO + shutdown(sfd, 2); + return (-1); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206251850.g5PIoPZ9004285>