Bug 121871

Summary: ftpd does not interpret configuration files as documented
Product: Documentation Reporter: Josh Webb <joshwebb>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Josh Webb 2008-03-19 16:50:03 UTC
I'm not sure if this is a problem with the documentation, ftpusers(5) and ftpd.conf(5), or with ftpd. According to the man pages, there should be three ways to chroot all ftp users to their home directories.

1) A line at the end of ftpusers:
* allow chroot
The documentation indicates that this should match all users not matched (and therefore denied access) in a previous line, allow them access to the server, and assign them to the chroot class, which defaults to chrooting them to their home directory.
In practice, the * is not interpreted, so it end up not matching any users. If I supply a specific user name, the user is blocked from ftp access, indicating the directive and class parts of the line are not being followed.

2) A single line in ftpchroot:
*
The documentation indicates that this should match all users and chroot them to their home directories (unless an alternative chroot cestination is specified in ftpd.conf).
In practice, the * is not interpreted, so it end up not matching any users. If I supply a specific user name, the user is chrooted correctly.

3) A single line in ftpd.conf:
chroot all %d
The documentation seems to indicate that this should match all users and chroot them to their home directories.
I have not been able to get any results from the chroot command in ftpd.conf
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-03-20 08:01:15 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-doc

This sounds like a documentation problem.
Comment 2 Vadim Goncharov 2008-03-20 09:39:07 UTC
Hi Josh Webb! 

On Wed, 19 Mar 2008 16:47:19 GMT; Josh Webb <joshwebb@gmail.com> wrote:

> 3) A single line in ftpd.conf:
> chroot all %d
> The documentation seems to indicate that this should match all users and chroot them to their home directories.
> I have not been able to get any results from the chroot command in ftpd.conf

May be you're trying to use ftpd.conf with ftpd(8), but actually there are TWO
ftp daemons in base system, and ftpd.conf(5) man page is for lukemftpd(8).
The latter is obtained from NetBSD and more featureful, but does not support
sendfile(2).

This can be not only documentation problem, but a buildworld config too, as
about two daemons installed at the SAME time.

-- 
WBR, Vadim Goncharov. ICQ#166852181       mailto:vadim_nuclight@mail.ru
[Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]
Comment 3 Josh Webb 2008-03-20 14:56:26 UTC
Oops, I left out the "not" from "ftpd does NOT interpret configuration 
files as documented". Obviously, interpreting the file as documented 
would not be a bug.
Comment 4 josh 2008-03-20 15:18:20 UTC
Yeah, looks like mostly a documentation problem.

The ftpchroot(5) man page, which is also the ftpusers(5) man page, 
indicates that it is for controlling ftpd(8). The ftpusers(5) man page 
references ftpd.conf(5), which as Vadim Goncharov stated, is only used 
by lukemftpd(8). If two ftp daemons are going to be included in the base 
system, both of which use ftpchroot and ftpusers but parse them 
differently, the man pages for those files should describe how they are 
used by each of the two daemons.

As a side note, it sounds like I can get the behavior I was looking for 
by using lukemftpd, rather than ftpd.
Comment 5 Maxim Konovalov freebsd_committer freebsd_triage 2010-09-01 11:52:36 UTC
State Changed
From-To: open->closed

This is well-known mess with the different versions of ftpd 
in the base system.  There are already several opened PRs 
regarding this issue (e.g. docs/44519, docs/93785).