Subject: bug#47625: closed (Re: bug#47625: 28.0.50; dired-do-symlink creates invalid symlinks when using Tramp)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 06 May 2021 11:17:02 +0000

Your bug report

#47625: 28.0.50; dired-do-symlink creates invalid symlinks when using Tramp

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47625: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47625
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#47625: 28.0.50; dired-do-symlink creates invalid symlinks when using Tramp
From: Michael Albinus <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], Filipp Gunbin <[email-masked]>
Date: Thu, 06 May 2021 13:15:29 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 28.1

Lars Ingebrigtsen <[email-masked]> writes:

Hi,

> Filipp Gunbin <[email-masked]> writes:
>
>> emacs -Q
>> open dired at /sudo::/tmp/
>> M-! touch foo
>> S (dired-do-symlink) on foo, enter /tmp/bar (without tramp prefix) at
>> the prompt
>> g (refresh dired)
>>
>> The result is "bar -> /sudo:[email-masked]:/tmp/foo", which is
>> an invalid symlink.
>
> I can reproduce this bug in Emacs 28, but I haven't tried to debug it.
> Perhaps it's obvious what's going wrong to somebody who knows how Tramp
> works; Michael added to the CCs.

Oops, I've overlooked this when it arrived. Sorry.

Same here, I can reproduce it. Surprisingly, it isn't a Tramp error,
because Tramp isn't involved :-)

The scenario described above results in the call

(make-symbolic-link "/sudo:root@server:/tmp/foo" "/tmp/bar" nil)

Tramp would be involved if either

- LINKNAME is a relative file name, and default-directory is remote, or
- LINKNAME is a remote file name.

LINKNAME is "/tmp/bar", and both conditions do not apply.

"/sudo:root@gandalf:/tmp/foo", the TARGET of the call, must only be a
string. Which syntax it is, or whether it is a valid file name, doesn't
matter.

So I fixed it in dired. If you try to create a symlink between two files
on different hosts, you'll get an error now.

Closing the bug.

Best regards, Michael.

Subject: 28.0.50; dired-do-symlink creates invalid symlinks when using Tramp
From: Filipp Gunbin <[email-masked]>
To: [email-masked]
Date: Tue, 06 Apr 2021 23:29:39 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

emacs -Q
open dired at /sudo::/tmp/
M-! touch foo
S (dired-do-symlink) on foo, enter /tmp/bar (without tramp prefix) at the prompt
g (refresh dired)

The result is "bar -> /sudo:[email-masked]:/tmp/foo", which is
an invalid symlink.

In GNU Emacs 28.0.50 (build 8, x86_64-apple-darwin20.3.0, NS appkit-2022.30 Version 11.2.1 (Build 20D74))
 of 2021-04-05 built on fgunbin.local
Repository revision: 257caab1d0bea17fb9bfb5a9e2c782cf96a7d052
Repository branch: master
System Description:  macOS 11.2.3