tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.2.13.25.2); emacs thinks 2 files are the same and they are


From: Michael Albinus
Subject: Re: tramp (2.2.13.25.2); emacs thinks 2 files are the same and they are not
Date: Wed, 26 Sep 2018 16:07:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Jon SCHEWE <address@hidden> writes:

Hi Jon,

> I first visited the file
> /su:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
> and made changes to it. I verified outside of emacs that this edited the
> file on my local system.
>
> I then asked emacs to visit the file
> /ssh:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
> and was given the message
>
> /ssh:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
> and
> /su:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
> are the same file
>
> These are in fact not the same files, the second one is on a remote host.
> So the only way to edit this remote file appears to be to login to the
> host and edit it there rather than from my local system.

Well, you are using Tramp's ad-hoc syntax for multi-hop
files. Internally, Tramp is using just the tail of the multi-hops, so
there is the mapping

/ssh:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
=> /sudo:address@hidden:/etc/logcheck/ignore.d.server/local

/su:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local
=> /sudo:address@hidden:/etc/logcheck/ignore.d.server/local

And yes, Tramp regards them as the same file then. As work-around, I
recommend to use for the first file the file name

/ssh:address@hidden|sudo:address@hidden:/etc/logcheck/ignore.d.server/local

Tramp would understand then, that both files are different.

This problem is known, and solved already in Tramp 2.4, which will be
part of the upcoming Emacs 27. In an ad-hoc multi-hop file name, host
names must match for methods like "su", "sg", "sudo", "doas", and "ksu".

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]