symlink issue with sftp

Bug #18500 reported by Niall Sheridan
24
Affects Status Importance Assigned to Milestone
GnomeVFS
Fix Released
Critical
gnome-vfs2 (Ubuntu)
Fix Released
Medium
Sebastien Bacher

Bug Description

When deleting a symlink to a directory over sftp in nautilus, it appears to dive
into the target directory and remove any files located there.

http://bugzilla.gnome.org/show_bug.cgi?id=153679: http://bugzilla.gnome.org/show_bug.cgi?id=153679

Revision history for this message
Rouslan Solomakhin (solomarv) wrote :

Please describe steps to reproduce or describe the link location and target. Is
it a real link (created by ln) or a desktop link (created by Places->Connect to
Server)?

Revision history for this message
Sebastien Bacher (seb128) wrote :

same issue with the current version

Revision history for this message
Ante Karamatić (ivoks) wrote :

OK. When there is a symlink to a directory it shown as broken, but erasing that
link will erase all files under the directory to wich that link points too. Next
time I tested it, trying to delete that same symlink, it asked me to confirm I
want to delete some other file (mbox). That other file was a link too! So, it's
major impact (data loss) on small portion of users - major severity.

Thanks for reporting!

Revision history for this message
Sebastien Bacher (seb128) wrote :

With GNOME 2.12 I get a dialog with retry/cancel. Does anybody still get the
issue described by the bug with the current packages?

Revision history for this message
Ante Karamatić (ivoks) wrote :

Me too. Nautilus is unable to delete that file. But there are still some issues
with nautilus and symlinks over ftp. First, it shows symlink as a file. When
clicked on that file it disapears and transforms to directory.

I consider this fixed.

Revision history for this message
Karl Hegbloom (karl.hegbloom) wrote :

The reason for this is that the sftp system does not support symlinks. They are
treated as the real file or directory that they point to. I learned this by
looking at the FUSE sshfs and shfs (iirc). I noticed it when I tried to use
'git' across an sshfs mounted directory. I believe that the same problem may
exist with an ftp based file system or gnome-vfs, since IIRC CMIIW ftp does not
have a symlink operation either.

There is not an easy way to fix this, since doing so probably involves extending
the sftp or ftp protocol to include symlinking. Certainly that is something it
should have. It could probably be emulated by having the interconnecting SSH
pipe set up to multiplex and then use a shell at the other end to run symlink
commands, and whatever else is needed to augment the base sftp protocol. For
ftp, that's not as easy to do, unless we luck out and it already has a symlink
capability.

Q: Does the new Samba 'CIFS' support everything needed for this kind of
application? Or, perhaps better, what about NFSv4? Can it do a secured over
the untrusted Internet file system export? Since it's RPC based, someone could
probably write a gnome-vfs driver for that... But it would seem to me that
setting up a way to get an automount via autofs or something would be more
global and easier to use; less redundant and probably more efficient. I have
not learned enough about the various options in this subject area to say a lot
more at this point.

Revision history for this message
Jussi Sainio (jusic) wrote :

> The reason for this is that the sftp system does not support symlinks.

That's not true. sftp does support symbolic links (At least OpenSSH's sftp
does) and fuse/sshfs plays quite well with them too. (At least in recent
versions 1.1 and 1.3.)

One comment in sshfs' source code caught my eye:

In function sshfs_symlink(): (line 1255 in sshfs-1.3 sources)

    /* openssh sftp server doesn't follow standard: link target and
       link name are mixed up, so we must also be non-standard :( */

Could that be the reason why Nautilus / GnomeVFS does odd things with
symbolic links? Just a thought.

(I don't personally use GnomeVFS for sftp, this just popped up while
I was searching for sshfs bugs.)

Revision history for this message
Sebastien Bacher (seb128) wrote :

Those issue are variants of upstream
http://bugzilla.gnome.org/show_bug.cgi?id=153679

Simon Law (sfllaw)
Changed in gnome-vfs2:
status: Unconfirmed → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

that should be fixed to edgy, feel free to reopen if that's still an issue for you

Changed in gnome-vfs2:
status: Confirmed → Fix Released
Changed in gnome-vfs:
status: Confirmed → Fix Released
Changed in gnome-vfs:
importance: Unknown → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.