From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aleksei Fedotov Newsgroups: gmane.emacs.bugs Subject: bug#53223: 27.2; multi-hop TRAMP with find-file-visit-truename t Date: Thu, 13 Jan 2022 21:54:02 +0100 Message-ID: <87sftr73x1.fsf@hp.cfotr.com> References: <877db48x7m.fsf@hp.cfotr.com> <87a6fzpwfr.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20454"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: 53223@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 13 21:57:52 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n87AO-00059v-4q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 21:57:52 +0100 Original-Received: from localhost ([::1]:56566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n87AM-0000aR-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 15:57:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n877f-0005JF-7O for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 15:55:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n877e-0000Zd-T3 for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 15:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n877e-0002TI-G0 for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 15:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aleksei Fedotov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jan 2022 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53223 X-GNU-PR-Package: emacs Original-Received: via spool by 53223-submit@debbugs.gnu.org id=B53223.16421072599434 (code B ref 53223); Thu, 13 Jan 2022 20:55:02 +0000 Original-Received: (at 53223) by debbugs.gnu.org; 13 Jan 2022 20:54:19 +0000 Original-Received: from localhost ([127.0.0.1]:34718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n876w-0002S5-QG for submit@debbugs.gnu.org; Thu, 13 Jan 2022 15:54:19 -0500 Original-Received: from mailtransmit05.runbox.com ([185.226.149.38]:54132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n876t-0002Rm-Qt for 53223@debbugs.gnu.org; Thu, 13 Jan 2022 15:54:18 -0500 Original-Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1n876n-00GdKx-BY for 53223@debbugs.gnu.org; Thu, 13 Jan 2022 21:54:09 +0100 Original-Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1n876m-0008RK-SB; Thu, 13 Jan 2022 21:54:09 +0100 Original-Received: by submission02.runbox with esmtpsa [Authenticated ID (873625)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1n876h-0002uv-HN; Thu, 13 Jan 2022 21:54:03 +0100 In-Reply-To: <87a6fzpwfr.fsf@gmx.de> (Michael Albinus's message of "Thu, 13 Jan 2022 15:00:40 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224137 Archived-At: >> I've spotted a problem with TRAMP when using multi-hop ssh with >> find-file-visit-truename set to t. >> >> Assuming that there is a remote machine XXX.YYY.com with SSH server. On local >> machine I run emacs like that: >> >>> emacs -Q --eval '(progn \ >>> (require (quote tramp)) \ >>> (setq find-file-visit-truename t) \ >>> (with-current-buffer (find-file "/ssh:root@XXX.YYYY.com|ssh:localhost:") \ >>> (tramp-cleanup-all-connections) \ >>> (revert-buffer)))' >> >> It successfully connects to the remote machine and opens dired buffer with the >> correct content, but the filename name in the dired header is not >> '/ssh:XXX.YYYY.com|ssh:localhost:' as I might expect, but >> '/ssh:localhost:/root:'. After (revert-buffer) I get an error in *Messages*: >> >>> tramp-handle-access-file: Reading directory: No such file or directory /ssh:localhost:/root/ >> >> The issue does not reproduce if find-file-visit-truename set to nil. It looks like 'file-truename' doesn't work correctly with multi-hop tramp file names. > > Tramp behaves as expected. You use an ad-hoc multi-hop remote file > name. Such ad-hoc definitions are removed when you call > `tramp-cleanup-all-connections'. This is described in the Tramp manual > (info "(tramp) Ad-hoc multi-hops") > (info "(tramp) Cleanup remote connections") > > If you want to keep multi-hop definitions permanently, configure > `tramp-default-proxies-alist' as described in the Tramp manual, or set > `tramp-save-ad-hoc-proxies' to t. See (info "(tramp) Multi-hops") It works exactly as described in the documentaion, but what is bothering me is the difference in behaviour depending on the state of `find-file-visit-truename'. It should only affect symlink resolution, but it also changes Tramp behaviour. If `find-file-visit-truename' is set to nil, then Tramp is able to revert the buffer and add a multi-hop definition back to `tramp-default-proxies-alist'. If `find-file-visit-truename' is set to t, then it doesn't work. Shouldn't the buffer somehow preserve the full path? -- Aleksei