Subject: bug#16984: dired-do-rename susceptible to .../~/... hijack

From: Michael Albinus <[email-masked]>
Date: Sun, 04 Dec 2016 20:06:43 +0100

[email-masked] writes:

Hi Noam,

>> This fixes the problem for local file names, but not for remote
>> ones. "/ssh:user@host:/path/~/file" would still be expanded to something
>> like "/ssh:user@host:/home/user/file". Well, better than nothing.
>>
>> What do people think to use the "/:" prefix also for the local part of
>> remote file names? Then one could use "/ssh:user@host:/:/path/~/file",
>> making substitute-in-file-name a noop.
>
> Makes sense to me.

I've added a patch to master which allows quoting the local part of the
file name. Maybe you could rewrite your patch, using this feature.

There are also three new functions tramp-quoted-name-p, tramp-quote-name
and tramp-unquote-name. Maybe it is worth to expose them more generally,
as file-name-quoted-p, file-name-quote and file-name-unquote.

Best regards, Michael.