From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: 23.0.50; pcmpl-ssh-hosts breaks when known_hosts file has a space in the wrong place Date: Mon, 24 Mar 2008 16:28:06 -0400 Message-ID: <18408.3798.278043.611553@fencepost.gnu.org> References: <8763viza9c.fsf@hagelb.org> <87iqzgx77t.fsf@hagelb.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206390578 8287 80.91.229.12 (24 Mar 2008 20:29:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2008 20:29:38 +0000 (UTC) Cc: Emacs developers To: Phil Hagelberg Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 24 21:30:08 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 1JdtHl-00007S-3R for ged-emacs-devel@m.gmane.org; Mon, 24 Mar 2008 21:28:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JdtHA-00052C-1Q for ged-emacs-devel@m.gmane.org; Mon, 24 Mar 2008 16:28:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JdtH6-00051x-Np for emacs-devel@gnu.org; Mon, 24 Mar 2008 16:28:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JdtH5-00051Z-AM for emacs-devel@gnu.org; Mon, 24 Mar 2008 16:28:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JdtH5-00051V-4q for emacs-devel@gnu.org; Mon, 24 Mar 2008 16:28:07 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JdtH4-0006ER-Q4 for emacs-devel@gnu.org; Mon, 24 Mar 2008 16:28:06 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1JdtH4-0001Ko-Cq; Mon, 24 Mar 2008 16:28:06 -0400 In-Reply-To: <87iqzgx77t.fsf@hagelb.org> X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: white X-Ran: #@e[^Y]PM`GzISLGhnQ;cOA"'rT((g~gmA2(YxD+xEI 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:93326 Archived-At: Please let's keep this on the list. Phil Hagelberg wrote (on Fri, 21 Mar 2008 at 11:28 -0700): > Glenn Morris writes: > > >> The function pcmpl-ssh-hosts (which is invoked when you launch > >> eshell and type "ssh host") fails when the last entry in your > >> pcmpl-ssh-known-hosts-file has a space after the hostname instead of > >> a comma. > > > > I don't understand what you mean. Do you mean they changed the format > > from this: > > > > host1,host1a,host1b,... bits exponent modulus comment > > > > to this > > > > host1 host1a host1b ... bits exponent modulus comment > > No, my understanding is that every line of the known_hosts file consists > of either: > > * A hostname, a separator, an IP address, a separator, then a > description of the key > * An IP address, a separator, then a description of the key > * A hostname, a separator, then a description of the key I quote from `man sshd' on my RHEL5 system: SSH_KNOWN_HOSTS FILE FORMAT ... Each line in these files contains the following fields: hostnames, bits, exponent, modulus, comment. The fields are separated by spaces. Hostnames is a comma-separated list of patterns... This is "OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006". > The problem the patch addresses is that the separator can be a comma > *or* a space. But it's not that complicated because what we really want > is just whatever appears before the first separator. > > I don't think we need to include the IP address for the first case above > since I believe once you do refer to a host by its IP address, it will > create another entry in the file that refers only to the IP address. My own known_hosts file contains many entries like this: host1.full.domain,host1,host1-alias,host-generic,ip1 ssh-rsa ... host2.full.domain,host2,host2-alias,host-generic,ip2 ssh-rsa ... There's nothing to say that the first entry is the only one I'll ever want to complete on (indeed it's usually one of the other forms).