GNU bug report logs - #27009
Tramp doesn't distinguish between connections differing only by port number

Previous Next

Package: emacs;

Reported by: "Devon Sean McCullough" <Emacs-Hacker2017 <at> jovi.net>

Date: Sun, 21 May 2017 16:12:03 UTC

Severity: normal

Tags: confirmed

Found in version 25.1

Fixed in version 26.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: "Devon Sean McCullough" <Emacs-Hacker2017 <at> jovi.net>
Cc: 27009 <at> debbugs.gnu.org
Subject: bug#27009: 25.1; Tramp stuck on wrong host
Date: Mon, 22 May 2017 14:03:19 +0200
"Devon Sean McCullough" <Emacs-Hacker2017 <at> jovi.net> writes:

Hi Davon,

> Tramp connects to the wrong host -- the user may not notice, leading to
> devastating damage.

Tramp is almost agnostic to port numbers. It uses them for the command
raised for connecting, but everywhere else it ignores them. This happens
especially in managing internal data, like the name of the connection
buffer or access to cached values.

As a result, two remote file names are handled as identical if they
differ only in their port numbers. See also the todo entry in tramp.el:

;; * Use also port to distinguish connections.  This is needed for
;;   different hosts sitting behind a single router (distinguished by
;;   different port numbers).  (Tzvi Edelman)

I know, this is not satisfying. If time permits, I'll work on this next
time. Unfortunately, there's no trivial fix.

As a workaround, use different host names. In your example, you could
use something like

(let ((one "/scp:localhost#11111:")
      (two "/scp:localhost.#22222:"))

Name resolution for "localhost" and "localhost." will return the same IP
address. But from the Tramp pov, the host names are different strings.

Best regards, Michael.




This bug report was last modified 7 years and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.