From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: bug#33266: guix-copy: Honor the SSH port of a host when defined in ~/.ssh/config Date: Thu, 08 Nov 2018 22:35:32 -0500 Message-ID: <871s7u53ej.fsf@gmail.com> References: <87a7mo5de4.fsf@gmail.com> <87o9b21ehv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKxaZ-0005ti-G3 for bug-guix@gnu.org; Thu, 08 Nov 2018 22:36:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKxaV-0002BT-US for bug-guix@gnu.org; Thu, 08 Nov 2018 22:36:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:37846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKxaU-0002AA-Lo for bug-guix@gnu.org; Thu, 08 Nov 2018 22:36:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gKxaU-0000oI-En for bug-guix@gnu.org; Thu, 08 Nov 2018 22:36:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87o9b21ehv.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 06 Nov 2018 15:12:44 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 33266@debbugs.gnu.org Hello! ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] > This looks good, and indeed it=E2=80=99s an unintended consequence of com= mit > cc1dfc202f2fefb6c2eb9467d1fc90a9154550c9. > > However, the log of commit cc1dfc had this: > > Failing to do that, "%p" would be "0" when using "ProxyCommand" > in ~/.ssh/config. Yeah, I had seen this message, but was doubting if it was still valid. Helas, it seems so: Given the ~/.ssh/config snippet (and configured machines): --8<---------------cut here---------------start------------->8--- Host vm-host HostName 10.5.5.5 User someuser =20=20=20=20=20 Host some-guest IdentityFile ~/.ssh/vm-host/id_rsa HostName some-guest User guest ProxyCommand ssh vm-host nc %h %p --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use (ssh session) scheme@(guile-user)> (make-session #:host "some-guest") $1 =3D #@some-guest:22 (disconnected) 11dffe0> scheme@(guile-user)> (session-get $1 'host) $2 =3D "some-guest" scheme@(guile-user)> (session-get $1 'port) $3 =3D 22 scheme@(guile-user)> (session-parse-config! $1 "~/.ssh/config") $4 =3D # scheme@(guile-user)> (session-get $1 'port) $5 =3D 22 scheme@(guile-user)> (connect! $1) $6 =3D error scheme@(guile-user)> (make-session #:host "some-guest" #:port 22) $7 =3D #@some-guest:22 (disconnected) 11dffc0> scheme@(guile-user)> (session-parse-config! $7 "~/.ssh/config") $8 =3D # scheme@(guile-user)> (session-get $7 'port) $9 =3D 22 scheme@(guile-user)> (connect! $7) $10 =3D ok --8<---------------cut here---------------end--------------->8--- > This is arguably a defect in either Guile-SSH or (more likely) libssh, > and it would be nice to report it. > > Would you like to report it upstream? It has to be in libssh. I'll try to come up with a repro in C, and submit the issue to them. When it's done, I'll add a note in the code. To be continued... Thanks for looking :) Maxim