Date: Mon, 20 Dec 1999 02:07:47 -0800 (PST) From: Joel.Faedi@esial.u-nancy.fr To: freebsd-gnats-submit@freebsd.org Subject: bin/15581: ftp(1) file completion does not work if server is wu-ftpd 2.6.0 Message-ID: <19991220100747.2E370152AB@hub.freebsd.org>
index | next in thread | raw e-mail
>Number: 15581
>Category: bin
>Synopsis: ftp(1) file completion does not work if server is wu-ftpd 2.6.0
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 20 02:10:03 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Joël Faedi
>Release: 3.3-RELEASE and -current
>Organization:
ESIAL
>Environment:
FreeBSD meduse.scinfo.u-nancy.fr 3.3-RELEASE FreeBSD 3.3-RELEASE #1: Sat Oct 9 17:59:09 CEST 1999 faedi@meduse.faedi.fr:/usr/src/sys/compile/MEDUSE i386
>Description:
ftp(1) file completion does not work if server is wu-ftpd 2.6.0. This is due to nlist (NLST) change in wu-ftpd 2.6.0.
You can see also docs/15408 (ls = dir != nlist).
>How-To-Repeat:
% ftp -d current.freebsd.org
Connected to usw2.freebsd.org.
220 usw2.freebsd.org FTP server (Version wu-2.6.0(1) Tue Dec 7 17:24:13 CST 1999) ready.
---> USER anonymous
331 Guest login ok, send your complete e-mail address as password.
---> PASS XXXX
230 Guest login ok, access restrictions apply.
---> SYST
215 UNIX Type: L8 Version: BSD-199506
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /p <<<<<<< TAB key pressed avec letter "p"
---> PORT 192,33,169,41,192,23
---> NLST /
550 No files found.
ftp> nlist /
---> PORT 192,33,169,41,192,24
200 PORT command successful.
---> NLST /
550 No files found.
ftp> nlist "-a /"
---> PORT 192,33,169,41,192,25
200 PORT command successful.
---> NLST -a /
150 Opening ASCII mode data connection for /bin/ls.
.
..
bin
etc
incoming
pub
usr
226 Transfer complete.
ftp> bye
---> QUIT
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 683 bytes in 1 transfers.
221-Thank you for using the FTP service on usw2.freebsd.org.
221 Goodbye.
>Fix:
When doing remote globing do a NLST "-a xxxx" (file util.c).
Here is a patch obtained with "diff -c util.c.old util.c > util.c.patch" from -current ftp/util.c ($FreeBSD: src/usr.bin/ftp/util.c,v 1.8 1999/08/28 01:01:35 peter Exp)
*** util.c.old Mon Dec 20 11:04:15 1999
--- util.c Mon Dec 20 10:36:41 1999
***************
*** 378,385 ****
hash = 0;
if (doswitch)
pswitch(!proxy);
! for (mode = "w"; *++argv != NULL; mode = "a")
! recvrequest("NLST", temp, *argv, mode, 0, 0);
if ((code / 100) != COMPLETE) {
if (errbuf != NULL)
*errbuf = reply_string;
--- 378,394 ----
hash = 0;
if (doswitch)
pswitch(!proxy);
! for (mode = "w"; *++argv != NULL; mode = "a") {
! char *nlst_argv;
!
! if ((nlst_argv = malloc(strlen(*argv) + 4)) == NULL) {
! warn("unable to allocate memory for remote globing");
! return (NULL);
! }
! (void)sprintf(nlst_argv, "-a %s", *argv);
! recvrequest("NLST", temp, nlst_argv, mode, 0, 0);
! free(nlst_argv);
! }
if ((code / 100) != COMPLETE) {
if (errbuf != NULL)
*errbuf = reply_string;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991220100747.2E370152AB>
