Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2003 22:35:05 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Brent Bailey <misterb@bmyster.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: chrooted ftpd
Message-ID:  <20030423213505.GA62181@happy-idiot-talk.infracaninophi>
In-Reply-To: <2449.66.63.99.171.1051127529.squirrel@bmyster.com>
References:  <2449.66.63.99.171.1051127529.squirrel@bmyster.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 23, 2003 at 03:52:09PM -0400, Brent Bailey wrote:
> thank you for your reponse......Your kidding me ...the stock ftpd that
> comes with FBSD 4.8 is so different that it no longer supports chroot ???
> Are we expected to to deinstall the package and installl some other port
> to just do chroot ?
> Are there any other ftp servers that can be used besides lukemftpd other
> than wu-ftpd...just to keep my options open.
> what about proftpd ??

No, the stock ftpd(8) apparently no longer supports the
FTPD_INTERNAL_LS compilation option.  It still does all of the
expected chroot(2) things.

The lukemftpd(8) that I mentioned seems to have internal ls
functionality by default:

    % find /usr/src -type f -print | xargs grep INTERNAL_LS
    /usr/src/contrib/lukemftpd/src/cmds.c:  char *argv[] =3D { INTERNAL_LS,=
 "-lgA", "", NULL };
    /usr/src/contrib/lukemftpd/src/extern.h:#define INTERNAL_LS     "/bin/l=
s"
    /usr/src/contrib/lukemftpd/src/ftpcmd.y:                        char *a=
rgv[] =3D { INTERNAL_LS, "-lgA", NULL };
    /usr/src/contrib/lukemftpd/src/ftpcmd.y:                        char *a=
rgv[] =3D { INTERNAL_LS, "-lgA", NULL, NULL };
    /usr/src/contrib/lukemftpd/src/ftpd.c:          if (strcmp(argv[0], INT=
ERNAL_LS) =3D=3D 0) {
    /usr/src/contrib/lukemftpd/src/ftpd.c:                          char *a=
rgv[] =3D { INTERNAL_LS, "", NULL };
    /usr/src/contrib/lukemftpd/src/popen.c:#ifndef NO_INTERNAL_LS
    /usr/src/contrib/lukemftpd/src/popen.c: isls =3D (strcmp(sl->sl_str[0],=
 INTERNAL_LS) =3D=3D 0);
    /usr/src/contrib/lukemftpd/src/popen.c:#ifndef NO_INTERNAL_LS
    /usr/src/contrib/lukemftpd/acconfig.h:#undef NO_INTERNAL_LS
    /usr/src/contrib/lukemftpd/config.h.in:#undef NO_INTERNAL_LS
    /usr/src/contrib/lukemftpd/configure:#define NO_INTERNAL_LS 1
    /usr/src/contrib/lukemftpd/configure.in:        AC_DEFINE(NO_INTERNAL_L=
S,1)
    /usr/src/libexec/lukemftpd/config.h:/* #undef NO_INTERNAL_LS */

 ... and the man page states:

     ftpd has internal support for handling remote requests to list files, =
and
     will not execute /bin/ls in either a chrooted or non-chrooted environ-
     ment.  The ~/bin/ls executable need not be placed into the chrooted tr=
ee,
     nor need the ~/bin directory exist.

There's no need to install any ports to get this functionality:
lukemftpd(8) is part of the base system.  All you need to do is edit
/etc/inetd.conf so that it calls /usr/libexec/lukemftpd rather than
/usr/libexec/ftpd.  The big difference seems to be that lukemftpd(8)
has more bells and whistles to make it more suitable for running a
serious anonymous FTP site, whereas ftpd(8) has IPv6 support.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--d6Gm4EdcadzBjdND
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+pwcJdtESqEQa7a0RAmNfAJ0WAszu++Q9XxOrBvg3sNk6EGbDngCggZfN
a45rPylQjrY/2ozL/qOub64=
=xCw5
-----END PGP SIGNATURE-----

--d6Gm4EdcadzBjdND--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030423213505.GA62181>