GNU bug report logs - #54130
29.0.50; TRAMP SSHFS can't visit remote files using absolute symlinks

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Wed, 23 Feb 2022 17:43:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 28.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 54130-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 54130-done <at> debbugs.gnu.org
Subject: Re: bug#54130: 29.0.50; TRAMP SSHFS can't visit remote files using
 absolute symlinks
Date: Thu, 24 Feb 2022 16:19:15 +0100
Version: 28.2

Philipp Stephani <p.stephani2 <at> gmail.com> writes:

Hi Philipp,

> On a remote host REMOTE, create an arbitrary file and an absolute
> symlink to it:
>
> REMOTE$ echo hi > /tmp/a.txt
> REMOTE$ ln -svi /tmp/{a,b}.txt
>
> Visiting the symlink from another host using SSH works as expected:
>
> emacs -Q /ssh:REMOTE:/tmp/b.txt
>
> But the same fails with SSHFS:
>
> emacs -Q /sshfs:REMOTE:/tmp/b.txt
>
> TRAMP prints a message "File exists, but cannot be read", and the buffer
> stays empty.

SSHFS interprets symbolic links on the local host. An absolute file name
cannot work, therefore.

I've added ("-o" "transform_symlinks") to the tramp-mount-args of the
sshfs Tramp method. This shall fix it. Pls unmount any sshfs mounts
prior testing, otherwise it wouldn't work.

An alternative would be to use ("-o" "follow_symlinks"). But this has
the disadvantage that symbolic links look like regular files then, so I
haven't used it.

Pushed to the repositories. You'll find it on the master branch, and in
the upcoming GNU ELPA Tramp 2.5.2.2. Closing the bug.

Best regards, Michael.




This bug report was last modified 3 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.