Cross device link / FTP

Joseph Kerian jkerian at
Wed Nov 2 11:07:29 PST 2005

On 11/2/05, Leo Lapousterle <lapousterle at> wrote:
> Hello :)
> I've set up a FTP server on my FreeBSD 5.2.1-RELEASE. I've added a hard
> drive to extend the storage capability. So my main FTP server is /Ftp and
> the extension is in /Ftp2.
> There's a problem with links: I made a symlink (ln -s) from /Ftp/example
> to
> /Ftp2/example/, but when I move a folder from /Ftp in "example", my FTP
> client tell me : "150 - Cannot rename/write: Cross device link".
> My FTP server is Pure-FTPd, the symlink's owner has good UID/GID, chmod
> allows the ftp user to access "example" for writing.
> If someone has an idea, this problem is getting me mad :)
> Thanks!
> --
> Léo Lapousterle - Paris, France

Hmm... interesting. I just tried this on my system. Sure enough, uploading
and downloading through those symlinks works fine, but not moving a file. I
found the problem on line 4024 of the ftpd.c file in pure-ftpd. It uses the
rename command to move the files, which will fail if the files are on
different file systems.

Do you explicitly require this functionality in the ftp server, rather than
just performing this via a shell session? The problem is that there is not a
similer C function call for "copy", so you can't just drop a replacement in.
I would consult with the pure-ftpd mailing list on this. The quick and easy
solutions to this are glaring security holes, so I might consult with them
over a way around this.


More information about the freebsd-questions mailing list