From owner-freebsd-questions Tue Oct 24 16: 4:30 2000 Delivered-To: freebsd-questions@freebsd.org Received: from irv1-mail2.intelenet.net (irv1-mail2.intelenet.net [204.182.160.3]) by hub.freebsd.org (Postfix) with ESMTP id D881737B479 for ; Tue, 24 Oct 2000 16:04:26 -0700 (PDT) Received: from boris.intelenet.net (davidhs@boris.intelenet.net [207.38.65.11]) by irv1-mail2.intelenet.net (8.9.3/8.9.3) with ESMTP id QAA26853; Tue, 24 Oct 2000 16:04:25 -0700 (PDT) Message-Id: <200010242304.QAA26853@irv1-mail2.intelenet.net> To: John.Place@rrd.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Anonymous FTP and Symlinks In-reply-to: Your message of Tue, 24 Oct 2000 23:51:26 +0300. <20001024235125.B6932@hades.hell.gr> Date: Tue, 24 Oct 2000 16:04:25 -0700 From: David Harnick-Shapiro Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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