From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 18 21:40:03 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A717716A420 for ; Wed, 18 Jan 2006 21:40:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2996D43D4C for ; Wed, 18 Jan 2006 21:40:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0ILe33P028255 for ; Wed, 18 Jan 2006 21:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0ILe23O028254; Wed, 18 Jan 2006 21:40:02 GMT (envelope-from gnats) Resent-Date: Wed, 18 Jan 2006 21:40:02 GMT Resent-Message-Id: <200601182140.k0ILe23O028254@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sergey Matveychuk Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD06616A41F for ; Wed, 18 Jan 2006 21:37:34 +0000 (GMT) (envelope-from sem@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79BDC43D53 for ; Wed, 18 Jan 2006 21:37:34 +0000 (GMT) (envelope-from sem@FreeBSD.org) Received: from freefall.freebsd.org (sem@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0ILbYdN028182 for ; Wed, 18 Jan 2006 21:37:34 GMT (envelope-from sem@freefall.freebsd.org) Received: (from sem@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0ILbYdm028181; Wed, 18 Jan 2006 21:37:34 GMT (envelope-from sem) Message-Id: <200601182137.k0ILbYdm028181@freefall.freebsd.org> Date: Wed, 18 Jan 2006 21:37:34 GMT From: Sergey Matveychuk To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/91973: libfetch: relax fetch(1) reaction on a MODE command absence X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sergey Matveychuk List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 21:40:03 -0000 >Number: 91973 >Category: bin >Synopsis: libfetch: relax fetch(1) reaction on a MODE command absence >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 18 21:40:02 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Sergey Matveychuk >Release: FreeBSD 6.0-STABLE i386 >Organization: >Environment: System: FreeBSD freefall.freebsd.org 6.0-STABLE FreeBSD 6.0-STABLE #0: Sat Dec 10 03:18:20 UTC 2005 kensmith@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386 >Description: I've found a problem with a new CWD implementation. The problem is with the URL: ftp://ftp.ac-grenoble.fr/ge/geosciences/xrmap/xrmap-2.33.tar.bz2. It's fetchable on <=6.0 and is not on -CURRENT. As I can see the site returns 500 code for MODE S command. An old libfetch implementation does not use the command so there was no problem. But a new `Change directory one level at a time' implementation send the command before a file transmitting and exits when fails. Well, looks like STD0009 requires a minimal implementation of ftp site must have a MODE command. But as I can see our ftp(1) treats an absence of the command as `only stream mode support'. I think we could be not so strict to the MODE command? Don't exit, just put a warning. >How-To-Repeat: >Fix: --- ftp.c.diff begins here --- --- lib/libfetch/ftp.c.orig Wed Jan 18 21:05:22 2006 +++ lib/libfetch/ftp.c Wed Jan 18 23:21:50 2006 @@ -366,10 +366,8 @@ filename = _ftp_filename(file, &filenamelen, &type); - if ((e = _ftp_mode_type(conn, 0, type)) != FTP_OK) { - _ftp_seterr(e); - return (-1); - } + if ((e = _ftp_mode_type(conn, 0, type)) != FTP_OK) + warnx("The site does not support a MODE command"); e = _ftp_cmd(conn, "SIZE %.*s", filenamelen, filename); if (e != FTP_FILE_STATUS) { @@ -601,7 +599,7 @@ /* set transfer mode and data type */ if ((e = _ftp_mode_type(conn, 0, type)) != FTP_OK) - goto ouch; + warnx("The site does not support a MODE command"); /* find our own address, bind, and listen */ l = sizeof(sa); --- ftp.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: