NetBSD Problem Report #13747

Received: (qmail 21906 invoked from network); 18 Aug 2001 18:30:19 -0000
Message-Id: <200108181833.f7IIXif00495@zorkmid.mit.edu>
Date: Sat, 18 Aug 2001 14:33:44 -0400 (EDT)
From: John Hawkinson <jhawk@mit.edu>
Reply-To: jhawk@mit.edu
To: gnats-bugs@gnats.netbsd.org
Subject: ftpd doesn't deal with LIST " "
X-Send-Pr-Version: 3.95

>Number:         13747
>Category:       bin
>Synopsis:       ftpd doesn't deal with LIST " "
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 18 18:31:00 +0000 2001
>Closed-Date:    
>Last-Modified:  Sun Aug 19 05:01:00 +0000 2001
>Originator:     John Hawkinson
>Release:        1.5.1
>Organization:
MIT
>Environment:

System: NetBSD zorkmid.mit.edu 1.5W NetBSD 1.5W (ZORKMID-$Revision: 1.12 $) #104: Sun Jun 24 21:48:35 EDT 2001 jhawk@zorkmid.mit.edu:/usr/local/netbsd-current/src/sys/arch/i386/compile/ZORKMID i386


>Description:
NetBSD's ftpd does not deal with receiving a
    LIST " "
query. This makes it rather hard to get the paged default output.

>How-To-Repeat:
Under most ftpd's, the default output of LIST can be obtained by
telling a client:

	dir ""

this means that one can easily enough view the output in a paged
fashion with:

	dir "" |more

which is quite a handy idiom. But it seems that

	dir ""

doesn't work with lukemftpd, so there's no way to get

	dir "" |more

to work. Now, you can say

	dir * |more

but this is undesirable because:

a)	It behaves differently, descending into directories.
b)	It means there is not one-stop shopping for all ftpds -- dir * will
	not work on OSes that do not understand wildcards.

>Fix:
	Fix ftpd to accept " " or "" to mean the same as the default string.
>Release-Note:
>Audit-Trail:

From: Luke Mewburn <lukem@wasabisystems.com>
To: John Hawkinson <jhawk@mit.edu>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/13747: ftpd doesn't deal with LIST " "
Date: Sun, 19 Aug 2001 14:16:35 +1000

 On Sat, Aug 18, 2001 at 02:33:44PM -0400, John Hawkinson wrote:
 > >Description:
 > NetBSD's ftpd does not deal with receiving a
 >     LIST " "
 > query. This makes it rather hard to get the paged default output.
 > 
 > >How-To-Repeat:
 > Under most ftpd's, the default output of LIST can be obtained by
 > telling a client:
 > 
 > 	dir ""
 > 
 > this means that one can easily enough view the output in a paged
 > fashion with:
 > 
 > 	dir "" |more
 > 
 > which is quite a handy idiom. But it seems that
 > 
 > 	dir ""
 > 
 > doesn't work with lukemftpd, so there's no way to get
 > 
 > 	dir "" |more
 > 
 > to work. Now, you can say
 > 
 > 	dir * |more
 > 
 > but this is undesirable because:
 > 
 > a)	It behaves differently, descending into directories.
 > b)	It means there is not one-stop shopping for all ftpds -- dir * will
 > 	not work on OSes that do not understand wildcards.
 > 
 > >Fix:
 > 	Fix ftpd to accept " " or "" to mean the same as the default string.

 This is most likely a client bug, not a server bug.

 Try using
 	dir . |more
 to work around it.

 What does
 	ftp netbsdhost:
 	[ login ]
 	> debug
 	> dir "" |more
 show?

 I.e, what is your ftp client sending the server.

 BTW: I just tried this with a NetBSD-current ftp client and ftp
 server, an
 	dir "" |less
 	dir . |less
 	pdir
 all appeared to do the same thing; I.e, pipe the output through less.

From: John Hawkinson <jhawk@MIT.EDU>
To: Luke Mewburn <lukem@wasabisystems.com>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/13747: ftpd doesn't deal with LIST " "
Date: Sun, 19 Aug 2001 01:05:12 -0400

 Luke Mewburn <lukem@wasabisystems.com> wrote on Sun, 19 Aug 2001
 at 14:16:35 +1000 in <20010819141635.E11876@wasabisystems.com>:

 > Try using
 > 	dir . |more
 > to work around it.

 This has the same problem as *, in that it requires the far end's OS
 to interpret "." specially...

 > What does
 > 	ftp netbsdhost:
 > 	[ login ]
 > 	> debug
 > 	> dir "" |more
 > show?
 > 
 > I.e, what is your ftp client sending the server.

 Under Solaris, to ftp.netbsd.org:

   dir "" /tmp/foo

 loses and just sends the output to stdout. This is a common
 client limitationn, and I screwed it up in my PR (oops). The
 right thing is

   dir " " /tmp/foo

 which produces:

 ftp> dir " " /tmp/foo
 output to local-file: /tmp/foo? y
 ---> PORT 18,187,2,149,155,71
 200 PORT command successful.
 ---> LIST  
 150 Opening ASCII mode data connection for '/bin/ls'.
 226 Transfer complete.
 [coleco-sidewinder!jhawk] ~> ls -ld /tmp/foo
 -rw-r--r--   1 jhawk    mit            0 Aug 19 01:04 /tmp/foo



 > BTW: I just tried this with a NetBSD-current ftp client and ftp
 > server, an
 > 	dir "" |less
 > 	dir . |less
 > 	pdir
 > all appeared to do the same thing; I.e, pipe the output through less.

 Are you certain it pipes it through less? On my 1.5 machine

 	dir "" /tmp/z

 does not write to /tmp/z.

 --jhawk
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.