Bug 15581

Summary: ftp(1) file completion does not work if server is wu-ftpd 2.6.0
Product: Base System Reporter: Joel Faedi <Joel.Faedi>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Joel Faedi 1999-12-20 10:10:03 UTC
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).

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)

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.
Comment 1 cpiazza freebsd_committer freebsd_triage 1999-12-20 10:16:49 UTC
State Changed
From-To: open->closed

Duplicate of PR bin/15580 
Comment 2 cpiazza freebsd_committer freebsd_triage 1999-12-20 16:55:21 UTC
State Changed
From-To: closed->open

This PR should be the one to stay open; it has a fix attached. 
Comment 3 Mike Barcroft freebsd_committer freebsd_triage 2001-07-21 19:26:03 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 4 Oscar Bonilla 2001-09-20 13:02:54 UTC
www ~ > uname -a
FreeBSD www.guug.org 4.4-RC FreeBSD 4.4-RC #202: Mon Sep  3 07:30:59 CST
2001     root@www.guug.org:/x/obj/usr/src/sys/GUUG  i386
www ~ > ftp -a -d istec.galileo.edu
Connected to istec.galileo.edu.
220 galileo.istec.org FTP server (Version wu-2.6.1(1) Thu Aug 31
11:22:43 MDT 2000) ready.
---> USER anonymous
331 Guest login ok, send your complete e-mail address as password.
---> PASS XXXX
230-
230-If there are any problems with ftp please mail:
230-
230-                 ftp@istec.org
230-
230-If you want to find out what is at this archive site please grab the
ls
230-files on the top level.  They are updated every night.  If the
information
230-is not in the format you want please mail ftp@istec.org.
230-
230-User 1230-Local time is Thu Sep 20 05:54:01 2001.
230-
230-
230-                                                                root

230-
230-
230 Guest login ok, access restrictions apply.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
of 100 allowed.
230-
ftp> cd /p---> EPSV
---> PASV
---> NLST /
ftp> nlist "/"
---> PASV
227 Entering Passive Mode (168,234,203,25,152,173)
---> NLST /
150 Opening ASCII mode data connection for file list.
/welcome.msg
226 Transfer complete.
ftp> nlist "-a /"
---> PASV
227 Entering Passive Mode (168,234,203,25,243,131)
---> NLST -a /
150 Opening ASCII mode data connection for /bin/ls.
.
..
bin
dev
etc
graphics
pub
public
usr
welcome.msg
226 Transfer complete.

### However, take a look at this:

ftp> cd /pub
---> CWD /pub
250 CWD command successful.
ftp> nlist "."
---> PASV
227 Entering Passive Mode (168,234,203,25,239,202)
---> NLST .
550 No files found.
ftp> nlist "-a ." foobar
output to local-file: foobar? y
---> PASV
227 Entering Passive Mode (168,234,203,25,14,219)
---> NLST -a .
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
ftp> !more foobar
/usr/local/bin/tcsh
freeware:
.
..
.mirror
SOURCES
forsunsites
i386
intel
sparc

gnu:
.
..
.mirror
.no.diff.README
=README
=README-about-.diff-files
=README-about-.gz-files
=README.~1~
=README.~2~
ABOUT-NLS
COPYING
COPYING-1.0
COPYING-2.0
COPYING.DOC
COPYING.LIB
COPYING.LIB-2.0
COPYING.LIB-2.1
FILES.bytime
FILES.bytime.gz
FILES.last24hours
FILES.last28days
FILES.last7days
GNUinfo
GNUsBulletins
GPL
LGPL
Licenses
MailingListArchives
Manuals
MicrosPorts
ProgramIndex
README
README-about-.diff-files
README-about-.gz-files
README.DESCRIPTIONS
README.GPLedSoftware
README.non-gnu-moved
a2ps
acct
acm.README
ada.README
ada.README.src
adns
autoconf
autogen
automake
avl
barcode
bash
bayonne
bc
binutils
bison
bool
brl.README
button.14.0.shar
calc
cfengine
cgicc
chess
cim
classpathx
clisp.README
clx
commonc++
commoncpp
config
cons
cpio
cpp2html
dap
dbmanual
dc.README
dclshar
ddd
dejagnu
dgs
dia.README
diction
dictionary
diffutils
dirent.tar.gz
djgpp.README
dld
dumb.README
ecc.README
ed
electric
elib.README
elisp-archive.README
emacs
enscript
etc
ffcall.README
fileutils
findutils
finger
flex.README
fontutils
free
freebuilder.README
g++.README
g77
gamma.README
gas.README
gawk
gcal
gcc
gcl
gcompris
gdb
gdbm
gengetopt
gettext
getting.gnu.software
gforth
ggradebook
ghostscript
ghostview
gift
gimp.README
git
gleem
glibc
global
glpk
gmp
gnans.README
gnat.README
gnat.README.src
gnats
gnatsweb
gnome.README
gnu-0.2
gnu-f2
gnu.ps.gz
gnucash.README
gnuchess.README
gnue
gnufsdb
gnugo
gnumach
gnupg.README
gnurobots
gnuserv.README
gnushogi
gnussl
goose
gpc.README
gpc.README~
gperf
gphoto.README
gprolog
graphics
graphics.README
greg
grep
grg.README
groff
gstep
gtk.README
gtkeyboard
gtypist
guile
gzip
halifax
hello
help2man
hp2xx
httptunnel
hurd
hyperbole
id-utils
ilisp.README
indent
inetutils
intlfonts
jacal
java
java2html
jwhois
kawa
less
libc
libg++
libiconv
libobjects
libstdc++
libtool
libxmi
lily.README
lilypond
lout.README
m4
mac
mailman
maintain
make
makeinfo.README
malloc.tar.gz
marst
maverik
mc
mcsim
mdk
metahtml
mifluz
mig
miscfiles
mkid.README
mkisofs.README
mm.README
motti
mule.README
nana.README
nano
ncurses
netfax.README
nihcl.README
non-gnu
objective-c.README
octal
octave
oleo
oops.README
p2c.README
paperclips
para
parted
patch
phantom
phttpd.README
pips
plotutils
poc
pth
ptx.README
queue
r.README
radius
rcs
readline
recode
regex
rx
sather
sauce
scm
screen
sed
serveez
sh-utils
sharutils
shtool
sipp.README
slib
smalleiffel.README
smalltalk
solfege
source-highlight
speedx
spell
spinner.README
src-highlite
standards
stow
superopt
sxml.README
tar
tasks
termcap
termutils
texinfo
texinfo.tex
textutils
time
toutdoux
trueprint
units
userv
uucp
uuencode.README
vcdimager
vera
vms.README
w3.README
wdiff
webbase
wget
which
winboard
windows
windows32api
xaos
xboard
xhippo
xinfo
xlogmaster
xmorph
xshogi
zlibc

mirror:
.
..
.mirror
CHANGES-since-2.8.txt
Lake.class
README.txt
copyright.html
experimental
ftp.pl_wupatch
index.html
mirror-2.9.tar.gz
mirror-2.9.zip
mirror-faq.html
mirror-on-dusk.gif
mirror.html
mirror.tar.gz
mirror.txt
mirror.zip
mm.html
quickstart.html
quickstart.txt
security_note.txt

security:
.
..
solaris
ftp> bye

# I don't know if this would be the behavior we want. listing
recursively
# all files and directories.

regards,

-Oscar

--
pgp fingerprint: BC64 2E7A CAEF 39E1 9544  80CA F7D5 784D FB46 16C1
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-30 09:20:33 UTC
State Changed
From-To: feedback->closed

Automatic feedback timeout.  This PR remained unchanged in the feedback 
state for more than 4 months. 

If additional feedback that warrants the re-opening of this PR is 
available but not included in the audit trail, please include the 
feedback in a reply to this message (preserving the Subject line) and 
ask that the PR be re-opened.