From owner-freebsd-ports Tue Jun 25 12: 2:41 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1D00F37B62F for ; Tue, 25 Jun 2002 12:00:08 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5PJ08J74609; Tue, 25 Jun 2002 12:00:08 -0700 (PDT) (envelope-from gnats) Received: from mail.inka.de (quechua.inka.de [212.227.14.2]) by hub.freebsd.org (Postfix) with ESMTP id 4C33D37B432 for ; Tue, 25 Jun 2002 11:50:52 -0700 (PDT) Received: from kemoauc.mips.inka.de (uucp@) by mail.inka.de with local-bsmtp id 17MvOs-0002VE-01; Tue, 25 Jun 2002 20:50:50 +0200 Received: from kemoauc.mips.inka.de (localhost [127.0.0.1]) by kemoauc.mips.inka.de (8.12.3/8.12.2) with ESMTP id g5PIoPBD004286 for ; Tue, 25 Jun 2002 20:50:25 +0200 (CEST) (envelope-from naddy@localhost.mips.inka.de) Received: (from naddy@localhost) by kemoauc.mips.inka.de (8.12.3/8.12.3/Submit) id g5PIoPZ9004285; Tue, 25 Jun 2002 20:50:25 +0200 (CEST) Message-Id: <200206251850.g5PIoPZ9004285@kemoauc.mips.inka.de> Date: Tue, 25 Jun 2002 20:50:25 +0200 (CEST) From: Christian Weisgerber Reply-To: Christian Weisgerber To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/39853: ftp/ncftp3 is broken on 64-bit archs Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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