Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2006 21:37:34 GMT
From:      Sergey Matveychuk <sem@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/91973: libfetch: relax fetch(1) reaction on a MODE command absence
Message-ID:  <200601182137.k0ILbYdm028181@freefall.freebsd.org>
Resent-Message-ID: <200601182140.k0ILe23O028254@freefall.freebsd.org>

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


>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:



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