GNU bug report logs - #33364
26.1.50; Tramp doesn't parse multiple hosts on a single line correctly

Previous Next

Package: emacs;

Reported by: Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>

Date: Tue, 13 Nov 2018 11:03:02 UTC

Severity: normal

Tags: patch

Found in version 26.1.50

Fixed in version 26.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33364 in the body.
You can then email your comments to 33364 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33364; Package emacs. (Tue, 13 Nov 2018 11:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Nov 2018 11:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.50; Tramp doesn't parse multiple hosts on a single line correctly
Date: Tue, 13 Nov 2018 12:01:06 +0100
Hello Everyone!

When, e.g. I put this "Host a b c d" into "~/.ssh/config" Emacs tramp
completion only suggests host "a" instead of host "a", "b", "c" and "d". But
"Host a b c d" is a valid syntax, bash completion offers all four hosts for
instance.

Adding " " to `tramp-host-regexp` doesn't solve the problem as it would result
in a host "a b c d", which is not what I wanted :-.

Thanks!

Christian




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33364; Package emacs. (Wed, 14 Nov 2018 13:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 33364 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>
Cc: 33364 <at> debbugs.gnu.org
Subject: Re: bug#33364: 26.1.50;
 Tramp doesn't parse multiple hosts on a single line correctly
Date: Wed, 14 Nov 2018 14:54:11 +0100
Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com> writes:

> Hello Everyone!

Hi Christian,

> When, e.g. I put this "Host a b c d" into "~/.ssh/config" Emacs tramp
> completion only suggests host "a" instead of host "a", "b", "c" and "d". But
> "Host a b c d" is a valid syntax, bash completion offers all four hosts for
> instance.

Indeed.

> Adding " " to `tramp-host-regexp` doesn't solve the problem as it would result
> in a host "a b c d", which is not what I wanted :-.

The following patch solves this for me:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 179a2c46..eb994c81 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -2922,7 +2922,9 @@ User is always nil."
    "Return a (user host) tuple allowed to access.
 User is always nil."
    (tramp-parse-group
-    (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)") 1 ","))
+    (concat "\\(?:^[ \t]*Host\\)" "\\|" "\\(?:^.+\\)"
+	    "\\|" "\\(" tramp-host-regexp "\\)")
+    1 "[ \t]+"))
 
 ;; Generic function.
 (defun tramp-parse-shostkeys-sknownhosts (dirname regexp)
--8<---------------cut here---------------end--------------->8---

I've made it towards the master branch, but the patch shall also apply
towards the emacs-26 branch.

Could you pls check whether it works for you?

> Thanks!
>
> Christian

Best regards, Michael.




Added tag(s) patch. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Wed, 14 Nov 2018 13:55:02 GMT) Full text and rfc822 format available.

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Wed, 14 Nov 2018 15:23:02 GMT) Full text and rfc822 format available.

Notification sent to Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>:
bug acknowledged by developer. (Wed, 14 Nov 2018 15:23:02 GMT) Full text and rfc822 format available.

Message #15 received at 33364-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com>
Cc: 33364-done <at> debbugs.gnu.org
Subject: Re: bug#33364: 26.1.50;
 Tramp doesn't parse multiple hosts on a single line correctly
Date: Wed, 14 Nov 2018 16:22:34 +0100
Version: 26.2

Christian Schwarzgruber <c.schwarzgruber.cs <at> gmail.com> writes:

> Hey Michael! 

Hi Christian,

[Pls keep the Cc, for the archives]

> Works, Great 👌

Thanks for the feedback. I've fixed this in the emacs-26 branch, closing
the bug.

> Thanks! 
>
> regards
> Christian

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Dec 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.