OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
ftpd chroot

From: Okan Demirmen (odemirmenkhaoz.org)
Date: Fri May 02 2003 - 00:12:13 CDT


So my question is related to the ftpd chroot implementation. The
best way for me to ask is via an example.

the users homedir is "/home/test" with a symlink in it,
"/home/test/www -> /var/www/users/test"

/etc/login.conf snip:
        :ftp-chroot:\
        :ftp-dir=~:

That will drop the user into their home directory from homedir in
passwd. Now obviously when ftpd' in, chdir to "www" will _not_ work
due to chroot (all good).

Now take the following values in /etc/login.conf
        :ftp-chroot:\
        :ftp-dir=~/www:

Again, ftpd will drop me into a chroot, but this time will honor
the symlink, and it chroots in /home/test/www which is really
/var/www/users/test.

My question is: is that intended?

If so, I wonder if taking ftp-dir to another level might be possible.
For example :ftp-dir=/var/www/users/$LOGNAME:.

Opinions? Flames?

Thanks,
Okan

--