Subject: bug#54130: 29.0.50; TRAMP SSHFS can't visit remote files using absolute symlinks

From: Philipp Stephani <[email-masked]>
Date: Thu, 24 Feb 2022 18:04:04 +0100

Am Do., 24. Feb. 2022 um 16:19 Uhr schrieb Michael Albinus
<[email-masked]>:
>
> Version: 28.2
>
> Philipp Stephani <[email-masked]> 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.

Thanks for the quick fix! Confirmed that it works now on master.

>
> 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.

Yes, agreed.