Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Oct 2000 16:04:25 -0700
From:      David Harnick-Shapiro <davidhs@intelenet.net>
To:        John.Place@rrd.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Anonymous FTP and Symlinks 
Message-ID:  <200010242304.QAA26853@irv1-mail2.intelenet.net>
In-Reply-To: Your message of Tue, 24 Oct 2000 23:51:26 %2B0300. <20001024235125.B6932@hades.hell.gr> 

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 24 Oct 2000 23:51, Giorgos Keramidas writes:

> On Tue, Oct 24, 2000 at 01:20:33PM -0500, John.Place@rrd.com wrote:
>
>> I am changing platforms for an _INTERNAL_ ftp server (to freebsd of corse).
>> The old platform (QNX) allowed me to set symlinks and they would be
>> followed.  FreeBSD will not.  I realize that this is because of
>> security purposes that it is like this but I am trying to make a
>> seemless change of platforms and some users will have a problem with
>> this.  Is there a way I can force ftpd to honor symlinks?
> 
> I think that it's not possible.  This is because ftpd (the one included
> with FreeBSD and some of the others that I know of), will call chroot()
> and change their `/' directory to the home of the "ftp" user when
> anonymous ftp is used.

I may have missed something here, but why not just use relative,
instead of absolute, symlinks?  As long as the target file and
the directory you're ftp-ing from have the same relationship to
each other under the "real" root and the chroot-ed root, that
should work.

For example, if /home/user1/ftpdir/mylink is a symlink to
"/home/user2/ftpdir/realfile", and you chroot to /home, that
path breaks.  But if mylink is a symlink to
../../user2/ftpdir/realfile, that path works in both cases.
(In the normal case, ../.. is "/home", and in the chrooted case,
../.. is "/", but it works in each case.)

David H-S


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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