Bug 22855

Summary: libfetch fails when older proxy doesn't understand MDTM command
Product: Base System Reporter: doug.pokorny <doug.pokorny>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-RELEASE   
Hardware: Any   
OS: Any   

Description doug.pokorny 2000-11-15 01:00:01 UTC
It appears that libfetch will always send a SIZE and MDTM command to the
remote FTP server as part of _ftp_stat in /usr/src/lib/libfetch/ftp.c.
Sites (such as ours) which use an older proxy server that doesn't understand
how to forwared MDTM commands will always fail.  As a result, the fetch
will always fail.

Here's a cleaned-up tcpdump of the conversation that libfetch had with 
the proxy:

230 Guest login ok, access restrictions apply.
TYPE I
200 Type set to I.
CWD /pub/FreeBSD/ports/distfiles
250 CWD command successful.
SIZE qpopper3.0.2.tar.gz
213 1734453
MDTM qpopper3.0.2.tar.gz
500 command not understood

At this point, the whole fetch fails.

Fix: 

My temporary workaround is to commend out the MDTM section of ftp.c -- however
this is not an ideal solution.  Perhaps _ftp_stat should simply not fail
if one of these commands returns an error and replace the failure with some
safe data.
How-To-Repeat: 
1)  Trap yourself behind an old BSDi proxy server
2)  Make fetch anything in /usr/ports
Comment 1 Doug Barton freebsd_committer freebsd_triage 2000-11-17 06:58:58 UTC
Responsible Changed
From-To: freebsd-bugs->des


Over to Mr. Fetch
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2000-11-17 14:07:44 UTC
State Changed
From-To: open->closed

Fixed ages ago (July 27th, to be exact)