From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#53847: 28.0.91; Tramp SSHFS: incorrect remote home directory Date: Wed, 09 Mar 2022 10:33:18 +0100 Message-ID: <87r17bv5b5.fsf@gmx.de> References: <871r0ct40m.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="6620"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53847@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 09 10:34:27 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 1nRsiB-0001YS-0G for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Mar 2022 10:34:27 +0100 Original-Received: from localhost ([::1]:42204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRsi9-0001UH-Jp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Mar 2022 04:34:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRshm-0001RV-Lr for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2022 04:34:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRshm-0006yA-Dw for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2022 04:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRshm-0002Go-72 for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2022 04:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Mar 2022 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53847 X-GNU-PR-Package: emacs Original-Received: via spool by 53847-submit@debbugs.gnu.org id=B53847.16468184088680 (code B ref 53847); Wed, 09 Mar 2022 09:34:02 +0000 Original-Received: (at 53847) by debbugs.gnu.org; 9 Mar 2022 09:33:28 +0000 Original-Received: from localhost ([127.0.0.1]:58545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRshE-0002Fw-94 for submit@debbugs.gnu.org; Wed, 09 Mar 2022 04:33:28 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:48061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRshB-0002Fe-Uc for 53847@debbugs.gnu.org; Wed, 09 Mar 2022 04:33:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646818399; bh=pqJ1po2XFX1w4pFRnRA2vH6dmqWAdD80cu34qTJNsco=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=GPamubz3pDjOY+pWd0ZVxF3vndCT1qxC4CqMcQR3l7xfJ9oVi7ZEWah9Y7FbQyoyK sF+wO5lduVISwNt8XMVYn9NEkSEp3qXV+QjkVd+rmWxJxq5uHfNSXQFjAVtng+NQ2I 73M7AJHOt1gVeAjzeYxIJjTAOnF2x7YJ2XIrUk4A= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([217.70.140.72]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7b2d-1nVRac0z4n-007yY1; Wed, 09 Mar 2022 10:33:19 +0100 In-Reply-To: (Philipp Stephani's message of "Wed, 9 Mar 2022 10:17:24 +0100") X-Provags-ID: V03:K1:DHVJlxp06TweBG6Serq2mJ4t1kN6b1yr/7bblt0g2QmsH6CtJ5p yuBiNkiFbI8MKS3QcznIRz4iOsEE3PHJJ28O7SRhYulxh77u9ArVyFLARjKvsgPWZRTx1ZY PA585PF5u3Q9ksioa5mAcmzZxfcmavm72ESMHAGZdkyjw/pBK5s4pq9D6kv6YmZhsph4+BB Ce2RxdU5JkUb9UtSyrcTA== X-UI-Out-Filterresults: notjunk:1;V03:K0:PlkdzvGG1fg=:O8VjP3ya/Ge5udHyKzhz2a TC77EMbnoJjIiyzrt75Yfb/Hm1EJ2A2gMx8x/hld7Bk8MnJU9JcSunOnerd5qjJm8W7sT4I+x YGhbh5Non/X+51Cya3FFBzAKCUcV2Pdxp2dBYetdP52iduJKPs8tVaDDskLnadGqa2Obm/beL xZU0QKys2p/BrTmi0QLuaGl0Qg6aZL+TmQYYXmCHwQGeb9MOxvaM825+XHk8r1QYPPampSAYs 7mG89AaLAOLq65bK4AjZ4a4YIPOuofUUYLWKfDxPuPFRMwI6jTPWjWaOx+00f/7X2IIR7xA5y 6NkRmROhIkp49W3D332PvBVPWpyTcOdD4EblPZg0vwIVeA8isOv+AMuoUbn7P8LTvugfmGyNb 8FX/Eji+qaarerNQFqLF7UU2tUdI0oFsdgntsA5bG3AHDx9+kzhTA819NxSv7wpMzdYKPqqfF 85AJTq5bfQPLqYTNBrY1cp5uq+2hZGWQExlzOQipcjvqKHHutT/mk/4qcVM/RZ1e7k6sQV3rX L43QCPk7UmiXkej3pTKkwfcyHBYYNQ+0VuLuU650NyiNqjeDGrKtbSi+qTQp1/6hMW/oVWf4Q tXuJUVG/I94w6rSJyzo5HLzJ0HMhW/rsWLDDgv3eYYrICK+D5MX1gqiG4Ow2b1rQDZdj+vgF7 YLyeGMVlNz0Fn7U0uTK5rjML8RnwpT19FGxB5Mr85nnXal6X28jK7mBZGm5vRG2jF9CIGSc0+ Le2zIAk08JPkGpD3llUF6+L635Mbzf0IDdjULNPzHdxzTwhjDjlGbNnnO3B7lvE1fv3PTDMM 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:228161 Archived-At: Philipp Stephani writes: Hi Philipp, >> > To reproduce this, you need two GNU/Linux machines with the same user >> > name but different home directories. Assume that on host 1 the user's >> > home directory is /home1/user, and that on host 2 the user's home >> > directory is /home2/user. With the SSH protocol, home directory >> > expansion works as expected: >> > >> > However, this fails with SSHFS: >> >> Tilde expansion is not possible for sshfs (and adb, rclone) methods of >> Tramp. I've added a check, and Tramp raises an error now when it detects >> a tilde. Pushed to master. > > Thanks, but would it maybe be possible to find a better solution? I've > been using SSHFS for a while now, and this particular issue is pretty > annoying in practice. How about any of the following: > - When connecting over SSHFS, ask the remote host (via SSH) for the > home directory and cache the result. > - Allow the user to configure a per-host static home directory (i.e. > just a customizable mapping from hosts + users to home directories). I > regularly only connect to 2 hosts with known hostnames and home > directories, so at least for me maintaining such a mapping would be > feasible. > WDYT? Tramp uses already a cached value for the home directory, under the key "~". You could try the following: --8<---------------cut here---------------start------------->8--- (add-to-list 'tramp-connection-properties (list (regexp-quote "/sshfs:user@randomhost.your.domain:") "~" "/home/user")) --8<---------------cut here---------------end--------------->8--- It is untested, and you need a fresh git checkout of master. Please report whether it works; I would add the recipe to the manual then. Best regards, Michael.