From nobody@FreeBSD.org  Sun Feb  1 14:37:45 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C105316A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  1 Feb 2004 14:37:45 -0800 (PST)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B773E43D31
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  1 Feb 2004 14:37:42 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i11MbgdL054570
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 1 Feb 2004 14:37:42 -0800 (PST)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.10/8.12.10/Submit) id i11MbgZV054569;
	Sun, 1 Feb 2004 14:37:42 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200402012237.i11MbgZV054569@www.freebsd.org>
Date: Sun, 1 Feb 2004 14:37:42 -0800 (PST)
From: Bob Finch <bob+freebsd@nas.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Some FTP clients cannot display directory listings via ftpd when logged in as non-guest
X-Send-Pr-Version: www-2.0

>Number:         62232
>Category:       bin
>Synopsis:       Some FTP clients cannot display directory listings via ftpd when logged in as non-guest
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 01 14:40:03 PST 2004
>Closed-Date:    Mon Feb 16 08:23:50 PST 2004
>Last-Modified:  Mon Feb 16 08:23:50 PST 2004
>Originator:     Bob Finch
>Release:        4.9-RELEASE
>Organization:
Network Access Services Inc.
>Environment:
FreeBSD romana.alphasoft.com 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Tue Jan 20 08:51:37 GMT 2004     bob@romana.alphasoft.com:/usr/src/sys/compile/ROMANA  i386

>Description:
Some FTP clients, notably Mozilla and Internet Explorer, fail to display directory listings when logged in as a non-guest user to ftpd.  It appears these clients depend on ftpd returning a 550 error when attempting to RETR a directory.  ftpd returns the raw directory which the client downloads as a binary file instead of displaying a directory listing.

These clients do display directory listings correctly when logged in as a guest user (anonymous), since ftp returns a 550 error when RETRing a directory when logged in as anonymous.
>How-To-Repeat:
From Mozilla, go to a FTP URL that refers to a directory and is not anonymous, e.g. ftp://someuser@some.site/some/dir/
>Fix:
The problem was introduced in revision 1.62.2.46 of src/libexec/ftpd/ftpd.c that allows non-guest users to download special files.  One fix would be to change

   if (guest) {

to

    if (guest || S_ISDIR(st.st_mode)) {

which would make ftpd always return a 550 error when attempting to RETR a directory.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Mon Feb 2 08:22:47 PST 2004 
Responsible-Changed-Why:  
Assign to our ftpd maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=62232 
State-Changed-From-To: open->patched 
State-Changed-By: yar 
State-Changed-When: Sat Feb 7 06:12:17 PST 2004 
State-Changed-Why:  
Fixed in CURRENT, thanks. 
I'll merge the fix into STABLE in a week. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=62232 

From: Yar Tikhiy <yar@FreeBSD.org>
To: bob+freebsd@nas.com
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/62232: Some FTP clients cannot display directory listings via ftpd when logged in as non-guest
Date: Sat, 7 Feb 2004 17:24:06 +0300

 By the way, do you know the Mozilla team's
 position as to this issue?  Personally, I'd
 consider it a Mozilla bug.
 
 -- 
 Yar
State-Changed-From-To: patched->closed 
State-Changed-By: yar 
State-Changed-When: Mon Feb 16 08:22:06 PST 2004 
State-Changed-Why:  
The proposed workaround has been added to ftpd(8) in 
CURRENT and STABLE, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=62232 
>Unformatted:
