#9 Implementation for directory_symlinks option


This small patch will add a new option "directory_symlinks" that will show any symbolic link as regular directories. This is pretty helpful in the following case:

Suppose you log in to some server and you're not chrooted, so:

curlftpfs ftp://some.server /mnt/server -o user=joe

Then "ls -la /mnt/server" will show the contents of /home/joe directory, and you don't have a way to see any files up in the hierarchy.

Now suppose you have a symbolic link in your home directory on the server: ftp -> /var/ftp

Without this patch /var/ftp will refer to your own /var/ftp, and that's now what we want. This could be fixed with the 'transform_symlinks' option but you don't have access to server's /var/ftp through curlftpfs, as explained above.

On the other hand, if we treat symlinks as directories, this will work perfectly. If you access, say, ftp/pub/somefile.txt this will work because on server this will get translated to /var/ftp/pub/somefile.txt which is correct.

There's a drawback when using this option though: this approach works only for directory symlinks. Symlinked files also appear as directories as there's no simple way to differentiate between a link to a directory and a link to a file :-( so you can't read symlinked files. But this is a minor drawback compared to the headache I had before I made this patch (I have lots of directory symlinks to different parts of the server's filesystem in my home directory).


  • Andrew Zabolotny

    Logged In: YES
    Originator: NO

    Oops sorry, somehow I posted the patch twice, once as anonymous :-(


Log in to post a comment.