From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#30946: 26.0.90; TRAMP cannot access some files when using hops Date: Mon, 31 Dec 2018 11:01:46 +1300 Message-ID: References: <87o9jbfcsc.fsf@petton.fr> <6e181a50-452c-0e8b-ae5a-0746f64a6dfb@orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1546207210 12688 195.159.176.226 (30 Dec 2018 22:00:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Dec 2018 22:00:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 To: 30946@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 30 23:00:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdj7t-0003AS-Ms for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2018 23:00:05 +0100 Original-Received: from localhost ([127.0.0.1]:46844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdj9z-0000Q2-Ef for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2018 17:02:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdj9p-0000Np-Mw for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 17:02:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdj9m-0000si-HR for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 17:02:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdj9m-0000s5-DG for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 17:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdj9m-0000OF-70 for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 17:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Dec 2018 22:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 30946-submit@debbugs.gnu.org id=B30946.1546207310997 (code B ref 30946); Sun, 30 Dec 2018 22:02:02 +0000 Original-Received: (at 30946) by debbugs.gnu.org; 30 Dec 2018 22:01:50 +0000 Original-Received: from localhost ([127.0.0.1]:42669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdj9a-0000Ff-9O for submit@debbugs.gnu.org; Sun, 30 Dec 2018 17:01:50 -0500 Original-Received: from smtp-1.orcon.net.nz ([60.234.4.34]:42868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdj9Y-0000De-Dx for 30946@debbugs.gnu.org; Sun, 30 Dec 2018 17:01:49 -0500 Original-Received: from [150.107.172.65] (port=44722 helo=[192.168.20.103]) by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1gdj9W-0001NG-DB for 30946@debbugs.gnu.org; Mon, 31 Dec 2018 11:01:47 +1300 In-Reply-To: <6e181a50-452c-0e8b-ae5a-0746f64a6dfb@orcon.net.nz> Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154041 Archived-At: (resending this to just the bug address, after unarchiving) On 26/03/18 9:42 PM, Nicolas Petton wrote: > As discussed on the emacs-devel mailing list, when using tramp with > multiple hops like the following: > > C-x C-f /ssh:me@example.com|sudo:localhost:/etc/deluser.conf > > Tramp opens an empty buffer, without showing any error message. > > I understand now that the second hop should be "sudo:example.com:", > but it felt intuitive to use localhost, and for most files on the > remote host it actually worked. I'd suspect that https://stackoverflow.com/a/16408592/324105 explains why it 'worked': > The trap here is that sudo:: does actually appear to work -- however > when you do that the HOST for the dynamic proxy entry will be the > hostname you originated from rather than the host you connected > to. This will not only look confusing (as the wrong host will be > displayed in the file paths), but it will also mean that any > subsequent attempt to use sudo:: on your localhost will instead be > proxied to the remote server! i.e. /ssh:me@example.com|sudo:localhost was previously creating a proxy that said that when you request files as root@localhost (for *any* tramp method!) it should proxy via "/ssh:me@example.com:". The sudo method didn't actually need or care about the specified host, so that "worked" -- but the proxy you'd created was then a problem waiting to bite you. Ooohh. Michael, that actually still remains a problem in the new version. Despite the error message, the unintended proxy is still created, and hence can still break things. i.e. I try to visit: /ssh:me@example.com|sudo:localhost I get the new error message: Host name ‘localhost’ does not match ‘^example.com$’ but I *also* get a new proxy entry: ("localhost" "root" "/ssh:me@example.com:") So when I then visit: /sudo:localhost: I get the error message: Host name ‘localhost’ does not match ‘^example.com$’ etc, etc... Conversely, it seems that the "::" case has been attended to so that it now transparently DWIM ? i.e. When I try /ssh:me@example.com|sudo:: I get a proxy entry of: ("example.com" "root" "/ssh:me@example.com:") whereas in earlier versions of Emacs I get the undesirable: ("" "root" "/ssh:me@example.com:") Where is my local hostname. That's excellent, and possibly also deserves a note in the NEWS? Currently it reads: *** For some connection methods, like "su" or "sudo", the host name in ad-hoc multi-hop file names must match the previous hop. We could perhaps append: If the hostname is left empty (e.g. "sudo::") then the host from the previous hop is used automatically. cheers, -Phil p.s. I find the new error slightly confusing to dismiss. It's not entirely obvious how to get back to the prompt. Not a big problem, as ideally people don't run into it at all, but I just thought I'd mention it. The error sticks around persistently until I type C-g, at which point I get a new error "Tramp: Opening connection for root@localhost using sudo...failed". That error also sticks around for a couple of seconds, which is long enough to make one suspect that it also needs to be dismissed with C-g -- which will actually exit the minibuffer entirely, meaning you can't simply edit the incorrect path to fix the problem, but must start over. (So the correct sequence is C-g and then either wait a couple of seconds, or just start typing blindly.) It would be nice if that was a bit smoother -- but again, I don't think this is a significant issue in reality, so I wouldn't worry about it unless you think it's easy to deal with.