From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Trent W. Buck" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Tramp 2.0 -> 2.1 migration woes Date: Mon, 28 Jan 2008 13:30:18 +1100 Message-ID: <20080128023016.GB3075@Clio.twb.ath.cx> References: <20080127040051.GA16241@Clio.twb.ath.cx> <87myqrfh8y.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2014833245==" X-Trace: ger.gmane.org 1201487443 18074 80.91.229.12 (28 Jan 2008 02:30:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jan 2008 02:30:43 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, rfrancoise@debian.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 28 03:31:03 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JJJm2-0005hf-NR for ged-emacs-devel@m.gmane.org; Mon, 28 Jan 2008 03:31:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJJlb-0002bB-N2 for ged-emacs-devel@m.gmane.org; Sun, 27 Jan 2008 21:30:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJJlY-0002b6-3T for emacs-devel@gnu.org; Sun, 27 Jan 2008 21:30:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJJlW-0002au-Fx for emacs-devel@gnu.org; Sun, 27 Jan 2008 21:30:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJJlW-0002ar-AI for emacs-devel@gnu.org; Sun, 27 Jan 2008 21:30:30 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJJlW-0001gn-7C for emacs-devel@gnu.org; Sun, 27 Jan 2008 21:30:30 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JJJlV-0002Nb-Jc for emacs-pretest-bug@gnu.org; Sun, 27 Jan 2008 21:30:29 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JJJlS-0001fr-HM for emacs-pretest-bug@gnu.org; Sun, 27 Jan 2008 21:30:29 -0500 Original-Received: from ipmail01.adl6.internode.on.net ([203.16.214.146]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJJlS-0001fd-24 for emacs-pretest-bug@gnu.org; Sun, 27 Jan 2008 21:30:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAKvNnEd5LOnP/2dsb2JhbACBWKhn X-IronPort-AV: E=Sophos;i="4.25,257,1199626200"; d="asc'?scan'208";a="30090949" Original-Received: from ppp121-44-233-207.lns2.mel4.internode.on.net (HELO Clio.twb.ath.cx) ([121.44.233.207]) by ipmail01.adl6.internode.on.net with ESMTP; 28 Jan 2008 13:00:19 +1030 In-Reply-To: <87myqrfh8y.fsf@gmx.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87678 gmane.emacs.pretest.bugs:20783 Archived-At: --===============2014833245== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 27, 2008 at 03:57:49PM +0100, Michael Albinus wrote: > "Trent W. Buck" writes: >=20 > > The initial hops are no longer shown in the path, nor on the first > > line of dired buffers. Already I have been VERY confused because > > a bad tramp-default-proxies-alist resulted in no proxy being used for > > > > /sudo:root@leek:/etc > > > > ...so that instead of editing leek's /etc as root, I was editing my > > laptop's /etc as root! Since the path claims that I'm on root@leek, I > > would have made disastrous changes to my local system if I hadn't > > noticed that there was no /etc/ssh/sshd_config (because sshd is not > > installed on my laptop). >=20 > The appended patch shall fix it. Could you, please, test? Yes, that seems to work, but I would extend the whitelist: - The class A network 127.0.0.0/8 - The unqualified system name (e.g. Clio instead of Clio.twb.ath.cx) - The comparison should be case-insensitive. Obviously this whitelist will never be perfect, e.g. if "mail" is a CNAME alias in on the DNS server for the local host, /sudo:mail: is meaningful but it would be hard to catch that. Maybe instead of an error, it should show a warning and continue? I'm not sure how you could make a warning pop up so that it would be seen by the user. Obviously `message' wouldn't work, because the echo area would be reused as tramp continued to sudo'ing to localhost. I would also change the error message to read "Host `foo' looks like a remote host, `sudo' can only use the local host." > *** /home/albinus/src/tramp/lisp/tramp.el.~2.624.~ 2008-01-26 15:19:11.00= 0000000 +0100 > --- /home/albinus/src/tramp/lisp/tramp.el 2008-01-27 15:43:19.000000000 += 0100 > *************** > *** 6052,6057 **** > --- 6052,6078 ---- > "Method `%s' is not supported for multi-hops." > (tramp-file-name-method item))))) > =20 > + ;; In case the host name is not used for the remote shell > + ;; command, the user could be misguided by applying a random > + ;; hostname. > + (let* ((v (car target-alist)) > + (method (tramp-file-name-method v)) > + (host (tramp-file-name-host v))) > + (unless > + (or > + ;; There are multi-hops. > + (cdr target-alist) > + ;; The host name is used for the remote shell command. > + (member > + '("%h") (tramp-get-method-parameter method 'tramp-login-args)) > + ;; The host is local. We cannot use `tramp-local-host-p' > + ;; here, because it opens a connection as well. > + (string-match > + (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") > + host)) > + (tramp-error > + v 'file-error "Wrong hostname `%s' for method `%s'" host method))) > +=20 > ;; Result. > target-alist)) > =20 --hHWLQfXTYDoKhP50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHnT44Lpef9iTtxAYRAoFEAKC6yrVwaV3r4WO47LzdYD7VzuLYfwCfRijV x+LuAV/fiwFEeLGRjRDa2E0= =8qqY -----END PGP SIGNATURE----- --hHWLQfXTYDoKhP50-- --===============2014833245== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============2014833245==--