From owner-freebsd-bugs Tue Apr 20 16:42:29 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 2F9E514E3D for ; Tue, 20 Apr 1999 16:42:28 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id QAA43664; Tue, 20 Apr 1999 16:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from mango.attlabs.att.com (gate.ipo.att.com [135.197.57.2]) by hub.freebsd.org (Postfix) with ESMTP id E8ED514D44 for ; Tue, 20 Apr 1999 16:41:23 -0700 (PDT) (envelope-from fenner@mango.attlabs.att.com) Received: (from fenner@localhost) by mango.attlabs.att.com (8.9.2/8.9.2) id QAA14027; Tue, 20 Apr 1999 16:38:40 -0700 (PDT) (envelope-from fenner) Message-Id: <199904202338.QAA14027@mango.attlabs.att.com> Date: Tue, 20 Apr 1999 16:38:40 -0700 (PDT) From: Bill Fenner Reply-To: fenner@research.att.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/11247: fetch doesn't notice FTP error after RETR starts Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11247 >Category: bin >Synopsis: fetch doesn't notice FTP error after RETR starts >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 20 16:40:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Bill Fenner >Release: FreeBSD 3.1-STABLE i386 >Organization: AT&T >Environment: fetch(1) since probably forever. >Description: During a valid FTP protocol exchange, during which an error occurs after the file transfer starts, such as: RETR foo ----> <---- 150 Opening BINARY mode data connection for fenner.tar.gz (264367025 bytes). <---- 500 Failed to contact content security server fetch(1) creates a zero-length file and exits with success. This is because 1) libftpio doesn't appear to provide a way to check the second return code (although it might be sufficiently confused to think that it was the return code for its "QUIT" request) 2) fetch doesn't check the return value of fclose(ftp), even though libftpio goes to some trouble to provide one. (Although RFC 959 doesn't explicitly list 550 as a valid response to a RETR command after the 150 preliminary response, the state machine on page 55 shows failing on any 4xx or 5xx result after the initial 1xx result) >How-To-Repeat: ftp a file through a Firewall/1 with aftpd and content security enabled while the content security server is unavailable. (Why do I always end up at places with weird firewalls?...) >Fix: Unknown. I know that libftpio is supposedly dead and libfetch is supposedly its replacement. However, libfetch doesn't appear to handle this problem either. (In fact, libfetch appears to never attempt to close the FTP connection cleanly, tsk tsk...) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message