Subject: bin/8504: ftpd refuses any login with error 421
To: None <>
From: None <p99dreyf@criens.u-psud>
List: netbsd-bugs
Date: 09/28/1999 00:55:00
>Number:         8504
>Category:       bin
>Synopsis:       ftpd refuses any login with error 421
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 28 00:35:00 1999
>Originator:     Emmanuel Dreyfus
>Release:        NetBSD/mac68k-1.4.1
NetBSD gizmo 1.4.1 NetBSD 1.4.1 (KERNEL) #0: Sun Sep 12 22:36:26 CEST 1999     r
oot@gizmo:/usr/src/sys/arch/mac68k/compile/KERNEL mac68k

When there is a blank line in /etc/ftpchroot, whatever the login is, 
after asking password, ftpd closes connection with error 421:
220 gizmo FTP server (Version: 7.1.0) ready.
Name ( manu
331 Password required for manu.
421 Service not available, remote server has closed connection.
ftp: Login failed.
ftp: No control connection for command.

The blank line breaks the FTP service. Since this is not documented in
the ftpd man page, I do consider it as a bug.
Add a blank line to /etc/ftpchroot, and try to log in.
Here was my /etc/ftpchroot file:
#       $NetBSD: ftpchroot,v 1.3 1997/01/04 14:03:34 mrg Exp $
# list of users given ftp access to a chrooted area.
# read by ftpd(8).


I think the source fix is to be around line 1220 in
/usr/src/libexec/ftpd/dftpd.c, but since the file is not extensively
documented, I don't know exactly what is to be changed, and I will not
submit a patch myself.