Jon SCHEWE <[email protected]> writes:

Hi Jon,

> I first visited the file
> /su:jschewe-adm@localhost|sudo:root@localhost:/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:[email protected]|sudo:root@localhost:/etc/logcheck/ignore.d.server/local
> and was given the message
>
> /ssh:[email protected]|sudo:root@localhost:/etc/logcheck/ignore.d.server/local
> and
> /su:jschewe-adm@localhost|sudo:root@localhost:/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:[email protected]|sudo:root@localhost:/etc/logcheck/ignore.d.server/local
=> /sudo:root@localhost:/etc/logcheck/ignore.d.server/local

/su:jschewe-adm@localhost|sudo:root@localhost:/etc/logcheck/ignore.d.server/local
=> /sudo:root@localhost:/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:[email protected]|sudo:[email protected]:/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.

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to