Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 16:38:40 -0700 (PDT)
From:      Bill Fenner <fenner@research.att.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/11247: fetch doesn't notice FTP error after RETR starts
Message-ID:  <199904202338.QAA14027@mango.attlabs.att.com>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904202338.QAA14027>